Commit 0198ff7e48c77b36b320afdca9f61848c68f32df
Committed by
GitHub
Merge pull request #1291 from m-holger/fuzz
In QPDFWordTokenFinder::check limit the token length
Showing
5 changed files
with
3 additions
and
3 deletions
.idea/cmake.xml
| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | <project version="4"> |
| 3 | 3 | <component name="CMakeSharedSettings"> |
| 4 | 4 | <configurations> |
| 5 | - <configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" /> | |
| 6 | 5 | <configuration PROFILE_NAME="Maintainer" ENABLED="true" CONFIG_NAME="RelWithDebInfo" GENERATION_OPTIONS="-DMAINTAINER_MODE=ON -DBUILD_STATIC_LIBS=OFF" /> |
| 7 | 6 | <configuration PROFILE_NAME="Windows" ENABLED="true" CONFIG_NAME="RelWithDebInfo" TOOLCHAIN_NAME="Visual Studio" GENERATION_OPTIONS="-DBUILD_SHARED_LIBS=OFF" /> |
| 8 | 7 | </configurations> | ... | ... |
fuzz/CMakeLists.txt
fuzz/qpdf_extra/99999d.fuzz
0 → 100644
No preview for this file type
fuzz/qtest/fuzz.test
| ... | ... | @@ -11,7 +11,7 @@ my $td = new TestDriver('fuzz'); |
| 11 | 11 | |
| 12 | 12 | my $qpdf_corpus = $ENV{'QPDF_FUZZ_CORPUS'} || die "must set QPDF_FUZZ_CORPUS"; |
| 13 | 13 | |
| 14 | -my $n_qpdf_files = 82; # increment when adding new files | |
| 14 | +my $n_qpdf_files = 83; # increment when adding new files | |
| 15 | 15 | |
| 16 | 16 | my @fuzzers = ( |
| 17 | 17 | ['ascii85' => 1], | ... | ... |
libqpdf/QPDFTokenizer.cc
| ... | ... | @@ -47,7 +47,7 @@ QPDFWordTokenFinder::check() |
| 47 | 47 | // Find a word token matching the given string, preceded by a delimiter, and followed by a |
| 48 | 48 | // delimiter or EOF. |
| 49 | 49 | QPDFTokenizer tokenizer; |
| 50 | - QPDFTokenizer::Token t = tokenizer.readToken(is, "finder", true); | |
| 50 | + QPDFTokenizer::Token t = tokenizer.readToken(is, "finder", true, str.size() + 2); | |
| 51 | 51 | qpdf_offset_t pos = is.tell(); |
| 52 | 52 | if (!(t == QPDFTokenizer::Token(QPDFTokenizer::tt_word, str))) { |
| 53 | 53 | QTC::TC("qpdf", "QPDFTokenizer finder found wrong word"); | ... | ... |