From 724b4a492febdea0e28986485f5d0c43fe7abc3c Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 16 Sep 2009 12:57:07 +0000 Subject: [PATCH] Add a couple of missing checks in validate_desc(), without which bogus game IDs were getting as far as new_game() and failing assertions. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@8655 cda61777-01e9-0310-a592-d414129be87e --- tents.c | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.11.0