mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Signpost: fix an out-of-bounds read.
Occurs when dragging with RMB outside the grid to unlink a path segment. This bug was discovered using ASan.
This commit is contained in:

committed by
Simon Tatham

parent
ebb50f0af2
commit
8e83f39eb9
@ -2069,7 +2069,7 @@ static void draw_drag_indicator(drawing *dr, game_drawstate *ds,
|
|||||||
int fx = FROMCOORD(ui->dx), fy = FROMCOORD(ui->dy);
|
int fx = FROMCOORD(ui->dx), fy = FROMCOORD(ui->dy);
|
||||||
double ang;
|
double ang;
|
||||||
|
|
||||||
if (validdrag) {
|
if (validdrag && INGRID(state, fx, fy)) {
|
||||||
/* If we could move here, lock the arrow to the appropriate direction. */
|
/* If we could move here, lock the arrow to the appropriate direction. */
|
||||||
dir = ui->drag_is_from ? state->dirs[ui->sy*w+ui->sx] : state->dirs[fy*w+fx];
|
dir = ui->drag_is_from ? state->dirs[ui->sy*w+ui->sx] : state->dirs[fy*w+fx];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user