1
0
Fork 0
forked from len0rd/rockbox

puzzles: add more parameter validation checks

Fixes some annoying crashes.

Change-Id: If3c293bd90e301c3e697d1e5fcb1b0aa2ea320fb
This commit is contained in:
Franklin Wei 2017-08-16 11:37:10 -04:00
parent c78ff7f615
commit f31a400bac
7 changed files with 15 additions and 2 deletions

View file

@ -179,6 +179,8 @@ static char *validate_params(const game_params *params, int full)
{
if (params->w <= 0 || params->h <= 0)
return "Width and height must both be greater than zero";
if (params->w * params->w < 2)
return "Grid must contain at least two squares";
return NULL;
}