diff options
| -rw-r--r-- | fuzz/bplist.dict | 1 | ||||
| -rw-r--r-- | fuzz/bplist_fuzzer.cc | 32 | ||||
| -rw-r--r-- | fuzz/bplist_fuzzer.options | 3 | ||||
| -rw-r--r-- | fuzz/xplist.dict | 51 | ||||
| -rw-r--r-- | fuzz/xplist_fuzzer.cc | 32 | ||||
| -rw-r--r-- | fuzz/xplist_fuzzer.options | 3 |
6 files changed, 122 insertions, 0 deletions
diff --git a/fuzz/bplist.dict b/fuzz/bplist.dict new file mode 100644 index 0000000..bb0ea5d --- /dev/null +++ b/fuzz/bplist.dict | |||
| @@ -0,0 +1 @@ | |||
| header_bplist = "bplist00" | |||
diff --git a/fuzz/bplist_fuzzer.cc b/fuzz/bplist_fuzzer.cc new file mode 100644 index 0000000..17d0649 --- /dev/null +++ b/fuzz/bplist_fuzzer.cc | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* | ||
| 2 | * bplist_fuzzer.cc | ||
| 3 | * binary plist fuzz target for libFuzzer | ||
| 4 | * | ||
| 5 | * Copyright (c) 2017 Nikias Bassen All Rights Reserved. | ||
| 6 | * | ||
| 7 | * This library is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU Lesser General Public | ||
| 9 | * License as published by the Free Software Foundation; either | ||
| 10 | * version 2.1 of the License, or (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This library is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * Lesser General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU Lesser General Public | ||
| 18 | * License along with this library; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <plist/plist.h> | ||
| 23 | #include <stdio.h> | ||
| 24 | |||
| 25 | extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) | ||
| 26 | { | ||
| 27 | plist_t root_node = NULL; | ||
| 28 | plist_from_bin(reinterpret_cast<const char*>(data), size, &root_node); | ||
| 29 | plist_free(root_node); | ||
| 30 | |||
| 31 | return 0; | ||
| 32 | } | ||
diff --git a/fuzz/bplist_fuzzer.options b/fuzz/bplist_fuzzer.options new file mode 100644 index 0000000..c0689b2 --- /dev/null +++ b/fuzz/bplist_fuzzer.options | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | [libfuzzer] | ||
| 2 | max_len = 4096 | ||
| 3 | dict = bplist.dict | ||
diff --git a/fuzz/xplist.dict b/fuzz/xplist.dict new file mode 100644 index 0000000..48b0367 --- /dev/null +++ b/fuzz/xplist.dict | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | ################################################################################ | ||
| 2 | # | ||
| 3 | # AFL dictionary for XML Property Lists | ||
| 4 | # ---------------------- | ||
| 5 | # | ||
| 6 | # Several basic syntax elements and attributes for libplist. | ||
| 7 | # | ||
| 8 | # Created by Nikias Bassen <nikias@gmx.li> | ||
| 9 | # Adapted from libxml2's dict file (created by Michal Zalewski <lcamtuf@google.com>) | ||
| 10 | # | ||
| 11 | |||
| 12 | attr_encoding=" encoding=\"1\"" | ||
| 13 | attr_generic=" a=\"1\"" | ||
| 14 | attr_version=" version=\"1\"" | ||
| 15 | |||
| 16 | entity_builtin="<" | ||
| 17 | entity_decimal="" | ||
| 18 | entity_external="&a;" | ||
| 19 | entity_hex="" | ||
| 20 | |||
| 21 | string_cdata="CDATA" | ||
| 22 | string_dashes="--" | ||
| 23 | string_empty="EMPTY" | ||
| 24 | string_empty_dblquotes="\"\"" | ||
| 25 | string_empty_quotes="''" | ||
| 26 | string_parentheses="()" | ||
| 27 | string_pcdata="#PCDATA" | ||
| 28 | string_percent="%a" | ||
| 29 | string_public="PUBLIC" | ||
| 30 | string_utf8="UTF-8" | ||
| 31 | |||
| 32 | tag_cdata="<![CDATA[" | ||
| 33 | tag_close="</plist>" | ||
| 34 | tag_doctype="<!DOCTYPE" | ||
| 35 | tag_open="<plist>" | ||
| 36 | tag_open_close="<plist />" | ||
| 37 | tag_open_exclamation="<!" | ||
| 38 | tag_open_q="<?" | ||
| 39 | tag_sq2_close="]]>" | ||
| 40 | tag_xml_q="<?xml?>" | ||
| 41 | tag_array="<array>" | ||
| 42 | tag_data="<data>" | ||
| 43 | tag_date="<date>" | ||
| 44 | tag_dict="<dict>" | ||
| 45 | tag_false="<false/>" | ||
| 46 | tag_integer="<integer>" | ||
| 47 | tag_key="<key>" | ||
| 48 | tag_plist="<plist>" | ||
| 49 | tag_real="<real>" | ||
| 50 | tag_string="<string>" | ||
| 51 | tag_true="<true/>" | ||
diff --git a/fuzz/xplist_fuzzer.cc b/fuzz/xplist_fuzzer.cc new file mode 100644 index 0000000..c477c4d --- /dev/null +++ b/fuzz/xplist_fuzzer.cc | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* | ||
| 2 | * xplist_fuzzer.cc | ||
| 3 | * XML plist fuzz target for libFuzzer | ||
| 4 | * | ||
| 5 | * Copyright (c) 2017 Nikias Bassen All Rights Reserved. | ||
| 6 | * | ||
| 7 | * This library is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU Lesser General Public | ||
| 9 | * License as published by the Free Software Foundation; either | ||
| 10 | * version 2.1 of the License, or (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This library is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * Lesser General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU Lesser General Public | ||
| 18 | * License along with this library; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <plist/plist.h> | ||
| 23 | #include <stdio.h> | ||
| 24 | |||
| 25 | extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) | ||
| 26 | { | ||
| 27 | plist_t root_node = NULL; | ||
| 28 | plist_from_xml(reinterpret_cast<const char*>(data), size, &root_node); | ||
| 29 | plist_free(root_node); | ||
| 30 | |||
| 31 | return 0; | ||
| 32 | } | ||
diff --git a/fuzz/xplist_fuzzer.options b/fuzz/xplist_fuzzer.options new file mode 100644 index 0000000..bad5dac --- /dev/null +++ b/fuzz/xplist_fuzzer.options | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | [libfuzzer] | ||
| 2 | max_len = 4096 | ||
| 3 | dict = xplist.dict | ||
