1
0
Fork 0
forked from len0rd/rockbox

puzzles: fix crash when loading a corrupt save

I misread the documentation here, thinking that the pointer would be set to
*point to* a null byte, not to a null pointer itself. [1]

[1]: https://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/midend.html#identify-game

Change-Id: I9b76bba9b1611dfd8e05d076a69f7554b5b74c53
This commit is contained in:
Franklin Wei 2020-06-27 20:24:31 -04:00
parent c02a9c5ab3
commit 7da8137bdb

View file

@ -3201,9 +3201,8 @@ static bool load_game(void)
char *game;
const char *ret = identify_game(&game, read_wrapper, (void*)fd);
if(!*game && ret)
if(!game && ret)
{
sfree(game);
rb->splash(HZ, ret);
rb->close(fd);
return false;