mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Require a grid description for hats grid
Without this, you can cause a null-pointer dereference by passing Loopy a game description with no grid description, like "10x10t16:".
This commit is contained in:
3
grid.c
3
grid.c
@ -3496,6 +3496,9 @@ static const char *grid_validate_desc_hats(
|
|||||||
struct HatPatchParams hp;
|
struct HatPatchParams hp;
|
||||||
const char *error = NULL;
|
const char *error = NULL;
|
||||||
|
|
||||||
|
if (!desc)
|
||||||
|
return "Missing grid description string.";
|
||||||
|
|
||||||
error = grid_desc_to_hat_params(desc, &hp);
|
error = grid_desc_to_hat_params(desc, &hp);
|
||||||
if (!error)
|
if (!error)
|
||||||
error = hat_tiling_params_invalid(&hp);
|
error = hat_tiling_params_invalid(&hp);
|
||||||
|
Reference in New Issue
Block a user