Skip to content

Commit

Permalink
Fix another potential use of pages array without checking (Issue #483)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Mar 28, 2022
1 parent 614fcba commit 3b44975
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- Fixed a potential image overflow bug with JPEG and PNG images (Issue #471)
- Fixed potential heap overflow bugs with pages (Issue #477, Issue #478,
Issue #480)
Issue #480, Issue #483)
- Fixed potential use-after-free in blocks (Issue #484)
- Fixed some minor Coverity warnings.
- Updated the GUI interface for current display fonts.
Expand Down
4 changes: 3 additions & 1 deletion htmldoc/ps-pdf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7198,26 +7198,28 @@ parse_table(tree_t *t, // I - Tree to parse
// Draw background on multiple pages...

// Bottom of first page...
check_pages(table_page);
new_render(table_page, RENDER_BOX, table.border_left, bottom,
width, table_y - bottom, bgrgb,
pages[table_page].start);

// Intervening pages...
for (temp_page = table_page + 1; temp_page < *page; temp_page ++)
{
check_pages(temp_page);
new_render(temp_page, RENDER_BOX, table.border_left, bottom,
width, top - bottom, bgrgb, pages[temp_page].start);
}

// Top of last page...
check_pages(*page);

new_render(*page, RENDER_BOX, table.border_left, *y,
width, top - *y, bgrgb, pages[*page].start);
}
else
{
// Draw background in row...
check_pages(table_page);
new_render(table_page, RENDER_BOX, table.border_left, *y,
width, table_y - *y, bgrgb, pages[table_page].start);
}
Expand Down

0 comments on commit 3b44975

Please sign in to comment.