From: Simon Tatham Date: Wed, 16 Sep 2009 12:57:07 +0000 (+0000) Subject: Add a couple of missing checks in validate_desc(), without which X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=4f6e48e6beafd73e052ec2454dc3a69949eee37e;p=sgt-puzzles.git Add a couple of missing checks in validate_desc(), without which bogus game IDs were getting as far as new_game() and failing assertions. [originally from svn r8655] --- diff --git a/tents.c b/tents.c index 134d44b..2c8b042 100644 --- a/tents.c +++ b/tents.c @@ -1210,6 +1210,10 @@ static char *validate_desc(game_params *params, char *desc) desc++; } + if (area < w * h + 1) + return "Not enough data to fill grid"; + else if (area > w * h + 1) + return "Too much data to fill grid"; for (i = 0; i < w+h; i++) { if (!*desc)