aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-06-30 08:25:47 +0000
committerSimon Tatham <anakin@pobox.com>2005-06-30 08:25:47 +0000
commit101324af67c5e7819849daeafb337dd4c1f45828 (patch)
treefa774543db4345abaaf58c7502ec6521198d7a7b
parent0494e94c4ace69b89e46943c2ddc1f8d09c44c8c (diff)
downloadpuzzles-101324af67c5e7819849daeafb337dd4c1f45828.zip
puzzles-101324af67c5e7819849daeafb337dd4c1f45828.tar.gz
puzzles-101324af67c5e7819849daeafb337dd4c1f45828.tar.bz2
puzzles-101324af67c5e7819849daeafb337dd4c1f45828.tar.xz
Attempting to begin a drag from (i.e. just click on) the hint pegs
for a past guess caused strangeness up to and including segfault, thanks to bad bounds checking. Well spotted John Sullivan. [originally from svn r6040]
-rw-r--r--guess.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/guess.c b/guess.c
index bf7a148..12d8b1b 100644
--- a/guess.c
+++ b/guess.c
@@ -637,7 +637,7 @@ static char *interpret_move(game_state *from, game_ui *ui, game_drawstate *ds,
} else {
over_hint = 1;
}
- } else if (x >= guess_ox &&
+ } else if (x >= guess_ox && x <= (guess_ox + GUESS_W) &&
y >= GUESS_OY && y < guess_oy) {
over_past_guess_y = (y - GUESS_OY) / PEGOFF;
over_past_guess_x = (x - guess_ox) / PEGOFF;