2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-29 00:10:54 +00:00

Eliminate one potential integer overflow

There are more to handle, but this resolves an issue already caught by
oss-fuzz.
This commit is contained in:
Jay Berkenbilt 2019-06-15 08:49:18 -04:00
parent d0b26b8337
commit cd830968ef

View File

@ -812,7 +812,7 @@ QPDF::read_xrefTable(qpdf_offset_t xref_offset)
"xref syntax invalid");
}
this->m->file->seek(this->m->file->getLastOffset() + bytes, SEEK_SET);
for (int i = obj; i < obj + num; ++i)
for (qpdf_offset_t i = obj; i - num < obj; ++i)
{
if (i == 0)
{