mirror of
https://github.com/qpdf/qpdf.git
synced 2024-05-30 08:50:51 +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>
|
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
|
* Add QIntC::range_check_substract to do range checking on
|
||||||
subtraction, which has different boundary conditions from
|
subtraction, which has different boundary conditions from
|
||||||
addition.
|
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/QPDFNumberTreeObjectHelper.hh>
|
||||||
#include <qpdf/NNTree.hh>
|
#include <qpdf/NNTree.hh>
|
||||||
|
#include <qpdf/QIntC.hh>
|
||||||
|
|
||||||
class NumberTreeDetails: public NNTreeDetails
|
class NumberTreeDetails: public NNTreeDetails
|
||||||
{
|
{
|
||||||
|
@ -235,6 +236,7 @@ QPDFNumberTreeObjectHelper::findObjectAtOrBelow(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
oh = i->second;
|
oh = i->second;
|
||||||
|
QIntC::range_check_substract(idx, i->first);
|
||||||
offset = idx - i->first;
|
offset = idx - i->first;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user