mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-02 22:50:20 +00:00
Add range check in QPDFNumberTreeObjectHelper (fuzz issue 37740)
This commit is contained in:
parent
ec09b91443
commit
a84a0b2487
@ -1,5 +1,7 @@
|
||||
2021-11-04 Jay Berkenbilt <ejb@ql.org>
|
||||
|
||||
* Add range check in QPDFNumberTreeObjectHelper (fuzz issue 37740).
|
||||
|
||||
* Add QIntC::range_check_substract to do range checking on
|
||||
subtraction, which has different boundary conditions from
|
||||
addition.
|
||||
|
BIN
fuzz/qpdf_extra/37740.fuzz
Normal file
BIN
fuzz/qpdf_extra/37740.fuzz
Normal file
Binary file not shown.
@ -1,5 +1,6 @@
|
||||
#include <qpdf/QPDFNumberTreeObjectHelper.hh>
|
||||
#include <qpdf/NNTree.hh>
|
||||
#include <qpdf/QIntC.hh>
|
||||
|
||||
class NumberTreeDetails: public NNTreeDetails
|
||||
{
|
||||
@ -235,6 +236,7 @@ QPDFNumberTreeObjectHelper::findObjectAtOrBelow(
|
||||
return false;
|
||||
}
|
||||
oh = i->second;
|
||||
QIntC::range_check_substract(idx, i->first);
|
||||
offset = idx - i->first;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user