From e5d106eb279c12d2454802421e723873e4bae6c2 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 12 Jan 2023 21:09:39 +0000 Subject: [PATCH] Don't allow negative clues in Pattern --- pattern.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pattern.c b/pattern.c index b0ea039..9904b80 100644 --- a/pattern.c +++ b/pattern.c @@ -913,6 +913,8 @@ static const char *validate_desc(const game_params *params, const char *desc) p = desc; while (*desc && isdigit((unsigned char)*desc)) desc++; n = atoi(p); + if (n < 0) + return "at least one clue is negative"; if (n > INT_MAX - 1) return "at least one clue is grossly excessive"; rowspace -= n+1;