aboutsummaryrefslogtreecommitdiff
path: root/samegame.c
diff options
context:
space:
mode:
Diffstat (limited to 'samegame.c')
-rw-r--r--samegame.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/samegame.c b/samegame.c
index 3abd042..c161234 100644
--- a/samegame.c
+++ b/samegame.c
@@ -1346,6 +1346,10 @@ static game_state *execute_move(const game_state *from, const char *move)
move++;
while (*move) {
+ if (!isdigit((unsigned char)*move)) {
+ free_game(ret);
+ return NULL;
+ }
i = atoi(move);
if (i < 0 || i >= ret->n) {
free_game(ret);