From b090c82df1527dcf348c96765f10ab5736c68c29 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 10 Jan 2023 00:32:25 +0000 Subject: [PATCH] Also limit Pegs to at least 1x1 even when not doing full validation --- pegs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pegs.c b/pegs.c index 29fe42e..54d1a21 100644 --- a/pegs.c +++ b/pegs.c @@ -183,6 +183,8 @@ static const char *validate_params(const game_params *params, bool full) { if (full && (params->w <= 3 || params->h <= 3)) return "Width and height must both be greater than three"; + if (params->w < 1 || params->h < 1) + return "Width and height must both be at least one"; if (params->w > INT_MAX / params->h) return "Width times height must not be unreasonably large";