aboutsummaryrefslogtreecommitdiff
path: root/nestedvm.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-01-07 23:06:13 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-01-15 16:21:37 +0000
commit023ce7554c19dcf6f4432407b9eedb850acc7289 (patch)
tree681946ee40ab920841ea560ebf2de6a3f0da94a8 /nestedvm.c
parent1aded127eb3fb7194a1752d96bfba95a5b7fa4dc (diff)
downloadpuzzles-023ce7554c19dcf6f4432407b9eedb850acc7289.zip
puzzles-023ce7554c19dcf6f4432407b9eedb850acc7289.tar.gz
puzzles-023ce7554c19dcf6f4432407b9eedb850acc7289.tar.bz2
puzzles-023ce7554c19dcf6f4432407b9eedb850acc7289.tar.xz
Sixteen: limit length of moves
The code that actually executes the moves can only cope with moves of at most the width (or height as appropriate) of the grid. Reject any longer move, and for symmetry also negative moves of the same magnitude. Without this, the tile-moving code tends to access off the start of the tile array. To demonstrate this, build Sixteen with AddressSanitizer and load this save file: SAVEFILE:41:Simon Tatham's Portable Puzzle Collection VERSION :1:1 GAME :7:Sixteen PARAMS :3:4x4 CPARAMS :3:4x4 DESC :38:2,16,3,10,13,8,7,4,9,14,12,11,15,1,5,6 NSTATES :1:2 STATEPOS:1:2 MOVE :4:C1,9
Diffstat (limited to 'nestedvm.c')
0 files changed, 0 insertions, 0 deletions