ptx: fix an invalid heap reference with short --width
commitca99c524e828cc1a1cfeff3cdfc5349f87143829
authorPádraig Brady <P@draigBrady.com>
Thu, 24 Nov 2016 15:56:01 +0000 (24 15:56 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 24 Nov 2016 16:21:59 +0000 (24 16:21 +0000)
tree0b674cd209096b522ec385692397c720a6e29cef
parent19157e87fd2a846a91dda5a4008b02cb6ba63593
ptx: fix an invalid heap reference with short --width

* src/ptx.c (fix_output_parameters): Ensure line_width doesn't
go negative, which can happen when the --width is less
than the --gap-size.
* tests/misc/ptx-overrun.sh: Add a test case that triggers
with ASAN.  (Note the longer filename is needed to trigger).
Fixes http://bugs.gnu.org/25011
src/ptx.c
tests/misc/ptx-overrun.sh