simon-git: puzzles (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Jun 21 19:05:27 BST 2018


TL;DR:
  3618f6a Fix NUL-termination bug in saving from Javascript.
  1d9cf25 Fix return value from newgame_undo_deserialise_read.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2018-06-21 19:05:27

commit 3618f6a07f71336ad5741836afb6aeb6cae3ff99
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=3618f6a07f71336ad5741836afb6aeb6cae3ff99;hp=506b07352ae225c74e79f6c6e7872bc2005bdb53
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jun 21 18:54:08 2018 +0100

    Fix NUL-termination bug in saving from Javascript.
    
    The JS code that retrieves the save-file data from emcc.c doesn't
    receive a separate length value, but instead expects the data to be in
    the form of a NUL-terminated string. But emcc.c wasn't NUL-terminating
    it, so the save data could come out with random cruft on the end.

 emcc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

commit 1d9cf25f27125da2aedbcbd2fc3519e3a4b8cce5
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1d9cf25f27125da2aedbcbd2fc3519e3a4b8cce5;hp=3618f6a07f71336ad5741836afb6aeb6cae3ff99
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jun 21 19:02:21 2018 +0100

    Fix return value from newgame_undo_deserialise_read.
    
    The read function used by midend_deserialise and friends is expected
    never to perform a partial read (the main deserialisation code always
    knows how many bytes it can expect to see), so it's specified to
    return simply TRUE or FALSE for success/failure, rather than the
    number of bytes read.
    
    This probably wasn't breaking anything, since in the case of
    deserialising from an internal memory buffer a short read could only
    arise due to an outright bug constructing the buffer. But now I've
    spotted it, I should fix it.

 midend.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)



More information about the tartarus-commits mailing list