aboutsummaryrefslogtreecommitdiff
path: root/untangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'untangle.c')
-rw-r--r--untangle.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/untangle.c b/untangle.c
index 06ed90c..1453afb 100644
--- a/untangle.c
+++ b/untangle.c
@@ -31,6 +31,7 @@
#include <string.h>
#include <assert.h>
#include <ctype.h>
+#include <limits.h>
#include <math.h>
#include "puzzles.h"
@@ -206,6 +207,8 @@ static const char *validate_params(const game_params *params, bool full)
{
if (params->n < 4)
return "Number of points must be at least four";
+ if (params->n > INT_MAX / 3)
+ return "Number of points must not be unreasonably large";
return NULL;
}