diff options
| author | Franklin Wei <git@fwei.tk> | 2017-08-16 11:37:10 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2017-08-16 11:40:42 -0400 |
| commit | f31a400bac0b72e773e32d2a17ac839145dded2b (patch) | |
| tree | dc812d909b41fe51870b568cc5e4cb2315b95c7c /apps/plugins/puzzles/src/netslide.c | |
| parent | c78ff7f6153d2a787bfd8cb3410dff8db74b2789 (diff) | |
| download | rockbox-f31a400bac0b72e773e32d2a17ac839145dded2b.zip rockbox-f31a400bac0b72e773e32d2a17ac839145dded2b.tar.gz rockbox-f31a400bac0b72e773e32d2a17ac839145dded2b.tar.bz2 rockbox-f31a400bac0b72e773e32d2a17ac839145dded2b.tar.xz | |
puzzles: add more parameter validation checks
Fixes some annoying crashes.
Change-Id: If3c293bd90e301c3e697d1e5fcb1b0aa2ea320fb
Diffstat (limited to 'apps/plugins/puzzles/src/netslide.c')
| -rw-r--r-- | apps/plugins/puzzles/src/netslide.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/netslide.c b/apps/plugins/puzzles/src/netslide.c index 663febc..96ac8e7 100644 --- a/apps/plugins/puzzles/src/netslide.c +++ b/apps/plugins/puzzles/src/netslide.c @@ -320,6 +320,8 @@ static char *validate_params(const game_params *params, int full) return "Barrier probability may not be negative"; if (params->barrier_probability > 1) return "Barrier probability may not be greater than 1"; + if (params->movetarget < 0) + return "Number of shuffling moves may not be negative"; return NULL; } |