Skip to content

Commit

Permalink
Fix a buffer underflow issue with GCC on Linux (Issue #360)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Dec 8, 2019
1 parent c1f19ab commit 8a129c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes in HTMLDOC v1.9.8

- Fixed a paragraph formatting issue with large inline images (Issue #369)
- Fixed a buffer underflow issue (Issue #370)


# Changes in HTMLDOC v1.9.7
Expand Down
4 changes: 3 additions & 1 deletion htmldoc/ps-pdf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3761,7 +3761,9 @@ render_contents(tree_t *t, /* I - Tree to parse */
nptr < (number + sizeof(number) - 1) && width < right;
width += dot_width)
*nptr++ = '.';
nptr --;

if (nptr > number)
nptr --;

strlcpy((char *)nptr, pages[hpage].page_text, sizeof(number) - (size_t)(nptr - number));

Expand Down

0 comments on commit 8a129c5

Please sign in to comment.