mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Patches from Ben Hutchings to fix failures of sscanf error checking.
[originally from svn r6147]
This commit is contained in:
2
pegs.c
2
pegs.c
@ -869,7 +869,7 @@ static game_state *execute_move(game_state *state, char *move)
|
||||
int sx, sy, tx, ty;
|
||||
game_state *ret;
|
||||
|
||||
if (sscanf(move, "%d,%d-%d,%d", &sx, &sy, &tx, &ty)) {
|
||||
if (sscanf(move, "%d,%d-%d,%d", &sx, &sy, &tx, &ty) == 4) {
|
||||
int mx, my, dx, dy;
|
||||
|
||||
if (sx < 0 || sx >= w || sy < 0 || sy >= h)
|
||||
|
Reference in New Issue
Block a user