Skip to content

Commit d6cd712

Browse files
committed
Fix a potential heap overflow bug with the table-of-contents (Issue #467)
1 parent f1adf63 commit d6cd712

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Fixed a potential stack overflow bug with GIF images (Issue #463)
66
- Fixed a potential heap underflow bug with empty attributes (Issue #464)
77
- Fixed a potential stack overflow bug with BMP images (Issue #466)
8+
- Fixed a potential heap overflow bug with the table-of-contents (Issue #467)
89
- Fixed a potential heap overflow bug with headings (Issue #468)
910

1011

htmldoc/ps-pdf.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2838,6 +2838,9 @@ pdf_write_contents(FILE *out, /* I - Output file */
28382838
* This is for the Table of Contents page...
28392839
*/
28402840

2841+
if (chapter_starts[0] < 0 || chapter_starts[0] >= (int)num_pages)
2842+
return;
2843+
28412844
thisobj = pdf_start_object(out);
28422845

28432846
fprintf(out, "/Parent %d 0 R", parent);

0 commit comments

Comments
 (0)