aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2009-09-16 12:57:07 +0000
committerSimon Tatham <anakin@pobox.com>2009-09-16 12:57:07 +0000
commit4f6e48e6beafd73e052ec2454dc3a69949eee37e (patch)
tree4427e992452fcae6ede4aeb47394694043e8f2f6
parent466c398a00de9b6df3d0846d55089ff419fd25ba (diff)
downloadpuzzles-4f6e48e6beafd73e052ec2454dc3a69949eee37e.zip
puzzles-4f6e48e6beafd73e052ec2454dc3a69949eee37e.tar.gz
puzzles-4f6e48e6beafd73e052ec2454dc3a69949eee37e.tar.bz2
puzzles-4f6e48e6beafd73e052ec2454dc3a69949eee37e.tar.xz
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]
-rw-r--r--tents.c4
1 files changed, 4 insertions, 0 deletions
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)