simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Feb 13 21:18:50 GMT 2023


TL;DR:
  73c7bc0 Twiddle: don't read off the end of parameter strings ending 'm'
  e336513 Loopy: free the grid description string if it's invalid
  da2767a Mosaic: don't duplicate the description being validated
  df783b9 Avoid division by zero in Cube grid-size checks

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2023-02-13 21:18:50

commit 73c7bc090155ab8c4661feaeea9e6a6e74ee6f77
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=73c7bc090155ab8c4661feaeea9e6a6e74ee6f77;hp=d577aaecab09506988a657fa257c4d0ab85d0cd6
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Feb 13 14:31:39 2023 +0000

    Twiddle: don't read off the end of parameter strings ending 'm'
    
    The overrun could be demonstrated by specifying a parameter string of
    "3x3m" to a build with AddressSanitizer.

 twiddle.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

commit e336513be755159158c5ba017c91b018ad4cd36c
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=e336513be755159158c5ba017c91b018ad4cd36c;hp=73c7bc090155ab8c4661feaeea9e6a6e74ee6f77
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Feb 13 20:17:58 2023 +0000

    Loopy: free the grid description string if it's invalid

 loopy.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

commit da2767a3f9bf4abb0436157972366202ad53a407
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=da2767a3f9bf4abb0436157972366202ad53a407;hp=e336513be755159158c5ba017c91b018ad4cd36c
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Feb 13 21:00:11 2023 +0000

    Mosaic: don't duplicate the description being validated
    
    Mosaic's validate_desc() doesn't write to the description string, so
    it has no need to make a copy of it.  And if it doesn't copy it, it
    can't leak the copy.

 mosaic.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

commit df783b93e3271264a8d54f90876f41a80ef2247d
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=df783b93e3271264a8d54f90876f41a80ef2247d;hp=da2767a3f9bf4abb0436157972366202ad53a407
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Feb 13 00:14:22 2023 +0000

    Avoid division by zero in Cube grid-size checks
    
    On a triangular grid, Cube allows either d1 or d2 (but not both) to be
    zero, so it's important to check that each one is not zero before
    dividing by it.
    
    The crash could be triggered by, for instance "cube t0x2".

 cube.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)



More information about the tartarus-commits mailing list