Mosaic: fix one-byte-too-short buffer in solve_game().

Thanks to Jason Hood for the report. The crash is trivially reproduced
under Address Sanitizer if you set up the game id 15x15#12345 and then
use the Solve UI action.
This commit is contained in:
Simon Tatham
2025-02-19 08:28:48 +00:00
parent b99f10727a
commit 7da4641222

View File

@ -951,7 +951,7 @@ static char *solve_game(const game_state *state,
return NULL; return NULL;
} }
ret = snewn((size / 4) + 3, char); ret = snewn((size / 4) + 4, char);
ret[0] = 's'; ret[0] = 's';
i = 0; i = 0;