diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-02-26 14:51:09 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-02-26 22:47:23 +0000 |
| commit | e2d390aae872cee4cb16d746af3b2eeb7713cbf5 (patch) | |
| tree | 121e6a20654de4db86231cb4a0750a6037096bc2 | |
| parent | 93be3f7ccaa63b0fd953bcfd88d685b47b76605e (diff) | |
| download | puzzles-e2d390aae872cee4cb16d746af3b2eeb7713cbf5.zip puzzles-e2d390aae872cee4cb16d746af3b2eeb7713cbf5.tar.gz puzzles-e2d390aae872cee4cb16d746af3b2eeb7713cbf5.tar.bz2 puzzles-e2d390aae872cee4cb16d746af3b2eeb7713cbf5.tar.xz | |
Map: reduce maximum size
validate_desc relies on being able to calculate 2*wh in an int, so the
maximum grid size is at most INT_MAX/2.
| -rw-r--r-- | map.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -255,7 +255,7 @@ static const char *validate_params(const game_params *params, bool full) { if (params->w < 2 || params->h < 2) return "Width and height must be at least two"; - if (params->w > INT_MAX / params->h) + if (params->w > INT_MAX / 2 / params->h) return "Width times height must not be unreasonably large"; if (params->n < 5) return "Must have at least five regions"; |