forked from qpdf/qpdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fuzzers to exercise specific pipeline classes
- Loading branch information
1 parent
43ff34b
commit 0ae344d
Showing
24 changed files
with
594 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,4 @@ manual/html.xsl | |
manual/print.xsl | ||
qpdf/build/ | ||
zlib-flate/build/ | ||
fuzz/qpdf_fuzzer_seed_corpus/ | ||
distribution/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <qpdf/Pl_Discard.hh> | ||
#include <qpdf/Pl_ASCII85Decoder.hh> | ||
#include <iostream> | ||
#include <stdexcept> | ||
|
||
class FuzzHelper | ||
{ | ||
public: | ||
FuzzHelper(unsigned char const* data, size_t size); | ||
void run(); | ||
|
||
private: | ||
void doChecks(); | ||
|
||
unsigned char const* data; | ||
size_t size; | ||
}; | ||
|
||
FuzzHelper::FuzzHelper(unsigned char const* data, size_t size) : | ||
data(data), | ||
size(size) | ||
{ | ||
} | ||
|
||
void | ||
FuzzHelper::doChecks() | ||
{ | ||
Pl_Discard discard; | ||
Pl_ASCII85Decoder p("decode", &discard); | ||
p.write(const_cast<unsigned char*>(data), size); | ||
p.finish(); | ||
} | ||
|
||
void | ||
FuzzHelper::run() | ||
{ | ||
try | ||
{ | ||
doChecks(); | ||
} | ||
catch (std::runtime_error const& e) | ||
{ | ||
std::cerr << "runtime_error: " << e.what() << std::endl; | ||
} | ||
} | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(unsigned char const* data, size_t size) | ||
{ | ||
FuzzHelper f(data, size); | ||
f.run(); | ||
return 0; | ||
} |
43 changes: 43 additions & 0 deletions
43
fuzz/ascii85_fuzzer_seed_corpus/a0113b6bc9b18c0d120bdf79f10a4928dc6fc908
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
70!<9iWTSm7K<E>iWTSm7fWNCiWTSm8,rWHiWTSm8H8`MiWTSm8cSiRiWTSm | ||
9)nrWiWTSm9E5&\iWTSm9`P/aiWTSm:&k8fiWTSm:B1AkiWTSm:]LJpiWTSm | ||
;#gSuiWTSm;?-]%iWTSm;ZHf*iWTSm;uco/iWTSm<<*#4iWTSm<WE,9iWTSm | ||
<r`5>iWTSm=9&>CiWTSm=TAGHiWTSm=o\P&M<.ZglicMP!!!"'J]"ig!<A%A | ||
q#CBoL!k&HkhZ:>!9c9E!!)4J#6=g,>KOe_2$i.E#lc1Zi<9Je!!!$!,nT#= | ||
#\X2<!!)9As8W-!,o#;A#\XJD!!)91s8W-!,oGSE#\XbL!!)9!s8W-!,okkI | ||
#\Y%T!!)8fs8W-!,p;.M#\Y=\!!)8Vs8W-!,p_FQ#\YUd!!)8Fs8W-!,q.^U | ||
#\Yml!!)86s8W-!,qS!Y#\Z0t!!)8&s8W-!,r"9]#\ZI'!!)7ks8W-!,rFQa | ||
#\Za/!!)7[s8W-!,rjie#\[$7!!)7Ks8W-!,s:,i#\[<?!!)7;s8W-!,s^Dm | ||
#\[TG!!)7+s8W-!,t-\q#\[lO!!)6ps8W-!,tQtu#\\/W!!)6`s8W-!,u!8$ | ||
#\\G_!!)9Qrr<#u,uEP(#\\_g!!)9Arr<#u,uih,#\]"o!!)91rr<#u-!9+0 | ||
#\];"!!)9!rr<#u-!]C4#\]S*!!)8frr<#u-",[8#\]k2!!)8Vrr<#u-"Ps< | ||
#\^.:!!)8Frr<#u-"u6@#\^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.aV#\Ymn!!)86qu?]r,qS$Z#\Z1!!!)8&qu?]r,r"<^ | ||
#\ZI)!!)7kqu?]r,rFTb#\Za1!!)7[qu?]r,rjlf#\[$9!!)7Kqu?]r,s:/j | ||
#\[<A!!)7;qu?]r,s^Gn#\[TI!!)7+qu?]r,t-_r#\[lQ!!)6pqu?]r,tR#! | ||
#\\/Y!!)6`qu?]r,u!;%#\\Ga!!)9QqZ$Tq,uES)#\\_i!!)9AqZ$Tq,uik- | ||
#\]"q!!)91qZ$Tq-!9.1#\];$!!)9!qZ$Tq-!]F5#\]S,!!)8fqZ$Tq-",^9 | ||
#\]k4!!)8VqZ$Tq-"Q!=#\^.<!!)8FqZ$Tq-"u9A#\^FD!!)86qZ$Tq-#DQE | ||
#\^^L!!)8&qZ$Tq-#hiI#\_!T!!)7kqZ$Tq-$8,M#\_9\!!)7[qZ$Tq-$\DQ | ||
#\_Qd!!)7KqZ$Qqzz!!!!Rm9YY.KB2Mu<)RB0Rfs(2&=Wh/;-%B"jobtRPPb | ||
C[oT5/rOH>QcOH>QcOH>Q(M<0BV#_5(Ziro\gF:@ITK>7VbLuJRDs3dTsiWT | ||
UG&;APTlc'+Liro\hahs3?M<0BV#b_gf"UKgtF:u(`!!!"Q^iTn'"=+Q:"UP | ||
.Tahs4%OH>QcOH>QcOH>Q(M<0BV(lLfgMbOV<:]u[VM+f0#a$_0]zM,Y`'M$ | ||
,*fQi6sbahs4"F=$ufM<0BV#`0NHMd6aJF<h!IFU3mu"H-:`MZts>1!q`($, | ||
La&Mb=>67L4oV%#\-p0uu*'$.'3I^kop\iW4rW,`0m+F<h!Gls7MgF=%!]+Q | ||
Wb4<Jfgk^i]p@70oY2jTPoq_i8g>NP$V=!!!"m+QWb4<Jfgk^i^*[,io18K> | ||
7M_,io18?,Mb`F=$ufKYWH+F:?1n~>trailing garbage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <qpdf/Pl_Discard.hh> | ||
#include <qpdf/Pl_DCT.hh> | ||
#include <iostream> | ||
#include <stdexcept> | ||
|
||
class FuzzHelper | ||
{ | ||
public: | ||
FuzzHelper(unsigned char const* data, size_t size); | ||
void run(); | ||
|
||
private: | ||
void doChecks(); | ||
|
||
unsigned char const* data; | ||
size_t size; | ||
}; | ||
|
||
FuzzHelper::FuzzHelper(unsigned char const* data, size_t size) : | ||
data(data), | ||
size(size) | ||
{ | ||
} | ||
|
||
void | ||
FuzzHelper::doChecks() | ||
{ | ||
Pl_Discard discard; | ||
Pl_DCT p("decode", &discard); | ||
p.write(const_cast<unsigned char*>(data), size); | ||
p.finish(); | ||
} | ||
|
||
void | ||
FuzzHelper::run() | ||
{ | ||
try | ||
{ | ||
doChecks(); | ||
} | ||
catch (std::runtime_error const& e) | ||
{ | ||
std::cerr << "runtime_error: " << e.what() << std::endl; | ||
} | ||
} | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(unsigned char const* data, size_t size) | ||
{ | ||
FuzzHelper f(data, size); | ||
f.run(); | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <qpdf/Pl_Discard.hh> | ||
#include <qpdf/Pl_Flate.hh> | ||
#include <iostream> | ||
#include <stdexcept> | ||
|
||
class FuzzHelper | ||
{ | ||
public: | ||
FuzzHelper(unsigned char const* data, size_t size); | ||
void run(); | ||
|
||
private: | ||
void doChecks(); | ||
|
||
unsigned char const* data; | ||
size_t size; | ||
}; | ||
|
||
FuzzHelper::FuzzHelper(unsigned char const* data, size_t size) : | ||
data(data), | ||
size(size) | ||
{ | ||
} | ||
|
||
void | ||
FuzzHelper::doChecks() | ||
{ | ||
Pl_Discard discard; | ||
Pl_Flate p("decode", &discard, Pl_Flate::a_deflate); | ||
p.write(const_cast<unsigned char*>(data), size); | ||
p.finish(); | ||
} | ||
|
||
void | ||
FuzzHelper::run() | ||
{ | ||
try | ||
{ | ||
doChecks(); | ||
} | ||
catch (std::runtime_error const& e) | ||
{ | ||
std::cerr << "runtime_error: " << e.what() << std::endl; | ||
} | ||
} | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(unsigned char const* data, size_t size) | ||
{ | ||
FuzzHelper f(data, size); | ||
f.run(); | ||
return 0; | ||
} |
Binary file added
BIN
+147 Bytes
fuzz/flate_fuzzer_seed_corpus/de72db41219fa2fc5113b4634a7c2bb437d48938
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <qpdf/Pl_Discard.hh> | ||
#include <qpdf/Pl_ASCIIHexDecoder.hh> | ||
#include <iostream> | ||
#include <stdexcept> | ||
|
||
class FuzzHelper | ||
{ | ||
public: | ||
FuzzHelper(unsigned char const* data, size_t size); | ||
void run(); | ||
|
||
private: | ||
void doChecks(); | ||
|
||
unsigned char const* data; | ||
size_t size; | ||
}; | ||
|
||
FuzzHelper::FuzzHelper(unsigned char const* data, size_t size) : | ||
data(data), | ||
size(size) | ||
{ | ||
} | ||
|
||
void | ||
FuzzHelper::doChecks() | ||
{ | ||
Pl_Discard discard; | ||
Pl_ASCIIHexDecoder p("decode", &discard); | ||
p.write(const_cast<unsigned char*>(data), size); | ||
p.finish(); | ||
} | ||
|
||
void | ||
FuzzHelper::run() | ||
{ | ||
try | ||
{ | ||
doChecks(); | ||
} | ||
catch (std::runtime_error const& e) | ||
{ | ||
std::cerr << "runtime_error: " << e.what() << std::endl; | ||
} | ||
} | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(unsigned char const* data, size_t size) | ||
{ | ||
FuzzHelper f(data, size); | ||
f.run(); | ||
return 0; | ||
} |
70 changes: 70 additions & 0 deletions
70
fuzz/hex_fuzzer_seed_corpus/1c43fc2a41e55a9e1cecce2013254b632f5afac4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
45000028e20508074600002ce205080747000030e205080748000034e20 | ||
5080749000038e20508074a00003ce20508074b000040e20508074c0000 | ||
44e20508074d000048e20508074e00004ce20508074f000050e20508075 | ||
0000054e205080751000058e20508075200005ce205080753000060e205 | ||
080754000064e205080755000068e20508075600006ce20508075700007 | ||
0e205080758000074e205080759000078e20508075a00005589e55383ec | ||
04e8000000005b81c3b44c01008b93f8ffffff85d27405e8de000000e83 | ||
5060000e840070100585bc9c3ff3508e10508ff250ce1050800000000ff | ||
2510e105086800000000e9e0ffffffff2514e105086808000000e9d0fff | ||
fffff2518e105086810000000e9c0ffffffff251ce105086818000000e9 | ||
b0ffffffff2520e105086820000000e9a0ffffffff2524e105086828000 | ||
000e990ffffffff2528e105086830000000e980ffffffff252ce1050868 | ||
38000000e970ffffffff2530e105086840000000e960ffffffff2534e10 | ||
5086848000000e950ffffffff2538e105086850000000e940ffffffff25 | ||
3ce105086858000000e930ffffffff2540e105086860000000e920fffff | ||
fff2544e105086868000000e910ffffffff2548e105086870000000e900 | ||
ffffffff254ce105086878000000e9f0feffffff2550e10508688000000 | ||
0e9e0feffffff2554e105086888000000e9d0feffffff2558e105086890 | ||
000000e9c0feffffff255ce105086898000000e9b0feffffff2560e1050 | ||
868a0000000e9a0feffffff2564e1050868a8000000e990feffffff2568 | ||
e1050868b0000000e980feffffff256ce1050868b8000000e970fefffff | ||
f2570e1050868c0000000e960feffffff2574e1050868c8000000e950fe | ||
ffffff2578e1050868d0000000e940feffffff257ce1050868d8000000e | ||
930feffffff2580e1050868e0000000e920feffffff2584e1050868e800 | ||
0000e910feffffff2588e1050868f0000000e900feffffff258ce105086 | ||
8f8000000e9f0fdffffff2590e105086800010000e9e0fdffffff2594e1 | ||
05086808010000e9d0fdffffff2598e105086810010000e9c0fdffffff2 | ||
59ce105086818010000e9b0fdffffff25a0e105086820010000e9a0fdff | ||
ffff25a4e105086828010000e990fdffffff25a8e105086830010000e98 | ||
0fdffffff25ace105086838010000e970fdffffff25b0e1050868400100 | ||
00e960fdffffff25b4e105086848010000e950fdffffff25b8e10508685 | ||
0010000e940fdffffff25bce105086858010000e930fdffffff25c0e105 | ||
086860010000e920fdffffff25c4e105086868010000e910fdffffff25c | ||
8e105086870010000e900fdffffff25cce105086878010000e9f0fcffff | ||
FF25D0E105086880010000E9E0FCFFFFFF25D4E105086888010000E9D0F | ||
CFFFFFF25D8E105086890010000E9C0FCFFFFFF25DCE105086898010000 | ||
E9B0FCFFFFFF25E0E1050868A0010000E9A0FCFFFFFF25E4E1050868A80 | ||
10000E990FCFFFFFF25E8E1050868B0010000E980FCFFFFFF25ECE10508 | ||
68B8010000E970FCFFFFFF25F0E1050868C0010000E960FCFFFFFF25F4E | ||
1050868C8010000E950FCFFFFFF25F8E1050868D0010000E940FCFFFFFF | ||
25FCE1050868D8010000E930FCFFFFFF2500E2050868E0010000E920FCF | ||
FFFFF2504E2050868E8010000E910FCFFFFFF2508E2050868F0010000E9 | ||
00FCFFFFFF250CE2050868F8010000E9F0FBFFFFFF2510E205086800020 | ||
000E9E0FBFFFFFF2514E205086808020000E9D0FBFFFFFF2518E2050868 | ||
10020000E9C0FBFFFFFF251CE205086818020000E9B0FBFFFFFF2520E20 | ||
5086820020000E9A0FBFFFFFF2524E205086828020000E990FBFFFFFF25 | ||
28E2050 8683 0020000E980FBFFFFFF252CE205086838020000E970FBFFF | ||
FFF2530E205086840020000E960FBFFFFFF2534E205086848020000E950 | ||
FBFFFFFF2538E205086850020000E940FBFFFFFF253CE20508685802000 | ||
0E930FBFFFFFF2540E205086860020000E920FBFFFFFF2544E205086868 | ||
020000E910FBFFFFFF2548E205086870020000E900FBFFFFFF254CE2050 | ||
86878020000E9F0FAFFFFFF2550E205086880020000E9E0FAFFFFFF2554 | ||
e205086888020000e9d0faffffff2558e205086890020000e9c0fafffff | ||
f255ce205086898020000e9b0faffffff2560e2050868a0020000e9a0fa | ||
ffffff2564e2050868a8020000e990faffffff2568e2050868b0020000e | ||
980faffffff256ce2050868b8020000e970faffffff2570e2050868c002 | ||
0000e960faffffff2574e2050868c8020000e950faffffff2578e205086 | ||
8d0020000e940faffff00000000000000000000000031ed5e89e183e4f0 | ||
50545268009b050868109b0508515668f0e60408e893fbfffff49090909 | ||
0909090909090909090905589e583ec08803dc8e3050800740ceb1c83c0 | ||
04a388e20508ffd2a188e205088b1085d275ebc605c8e3050801c9c3905 | ||
589e583ec08a110e0050885c07412b80000000085c07409c7042410e005 | ||
08ffd0c9c3909090909090909090909090905589e583ec188b45088b4d0 | ||
c8b50048b00894c2408c744240c0000000089542404890424e897fe0000 | ||
c9c3908d7426005589e583ec08891c248b5d0c897424048b75088b4b048 | ||
b56048b06330331d131d209c1751a8b4b088b46088b5b0c8b560c31c831 | ||
da09d00f94c089c283e2018b1c2489d08b74240489ec5dc38d742600a12 | ||
0e505085589e585c075088b4508a320e505085dc38d76008dbc27000000 | ||
00a120e505085589e585c0750da124e5050883c001a324e505085dc3908 | ||
d7426005584c089e5740cc705>trailing farbage |
Oops, something went wrong.