Commit 5c6e695c authored by Nikias Bassen's avatar Nikias Bassen

Add fuzzing targets for libFuzzer used by Google's OSS-Fuzz

parent 62ec8047
header_bplist = "bplist00"
/*
* bplist_fuzzer.cc
* binary plist fuzz target for libFuzzer
*
* Copyright (c) 2017 Nikias Bassen All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <plist/plist.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size)
{
plist_t root_node = NULL;
plist_from_bin(reinterpret_cast<const char*>(data), size, &root_node);
plist_free(root_node);
return 0;
}
[libfuzzer]
max_len = 4096
dict = bplist.dict
################################################################################
#
# AFL dictionary for XML Property Lists
# ----------------------
#
# Several basic syntax elements and attributes for libplist.
#
# Created by Nikias Bassen <nikias@gmx.li>
# Adapted from libxml2's dict file (created by Michal Zalewski <lcamtuf@google.com>)
#
attr_encoding=" encoding=\"1\""
attr_generic=" a=\"1\""
attr_version=" version=\"1\""
entity_builtin="&lt;"
entity_decimal="&#1;"
entity_external="&a;"
entity_hex="&#x1;"
string_cdata="CDATA"
string_dashes="--"
string_empty="EMPTY"
string_empty_dblquotes="\"\""
string_empty_quotes="''"
string_parentheses="()"
string_pcdata="#PCDATA"
string_percent="%a"
string_public="PUBLIC"
string_utf8="UTF-8"
tag_cdata="<![CDATA["
tag_close="</plist>"
tag_doctype="<!DOCTYPE"
tag_open="<plist>"
tag_open_close="<plist />"
tag_open_exclamation="<!"
tag_open_q="<?"
tag_sq2_close="]]>"
tag_xml_q="<?xml?>"
tag_array="<array>"
tag_data="<data>"
tag_date="<date>"
tag_dict="<dict>"
tag_false="<false/>"
tag_integer="<integer>"
tag_key="<key>"
tag_plist="<plist>"
tag_real="<real>"
tag_string="<string>"
tag_true="<true/>"
/*
* xplist_fuzzer.cc
* XML plist fuzz target for libFuzzer
*
* Copyright (c) 2017 Nikias Bassen All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <plist/plist.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size)
{
plist_t root_node = NULL;
plist_from_xml(reinterpret_cast<const char*>(data), size, &root_node);
plist_free(root_node);
return 0;
}
[libfuzzer]
max_len = 4096
dict = xplist.dict
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment