From 6bbfc0b62f224862ea371b9a36432406b791f779 Mon Sep 17 00:00:00 2001 From: Abhishek Arya Date: Tue, 7 Feb 2017 15:28:57 -0800 Subject: [PATCH] Fix UBSAN error with function argument casting. (#362) --- projects/libplist/bplist_fuzzer.cc | 4 ++-- projects/libplist/xplist_fuzzer.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/libplist/bplist_fuzzer.cc b/projects/libplist/bplist_fuzzer.cc index 3a1ecb115..6eca272aa 100644 --- a/projects/libplist/bplist_fuzzer.cc +++ b/projects/libplist/bplist_fuzzer.cc @@ -19,10 +19,10 @@ #include #include -extern "C" int LLVMFuzzerTestOneInput(const char* data, size_t size) +extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) { plist_t root_node = NULL; - plist_from_bin(data, size, &root_node); + plist_from_bin(reinterpret_cast(data), size, &root_node); plist_free(root_node); return 0; diff --git a/projects/libplist/xplist_fuzzer.cc b/projects/libplist/xplist_fuzzer.cc index b38d93eaf..50258eec5 100644 --- a/projects/libplist/xplist_fuzzer.cc +++ b/projects/libplist/xplist_fuzzer.cc @@ -19,10 +19,10 @@ #include #include -extern "C" int LLVMFuzzerTestOneInput(const char* data, size_t size) +extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) { plist_t root_node = NULL; - plist_from_xml(data, size, &root_node); + plist_from_xml(reinterpret_cast(data), size, &root_node); plist_free(root_node); return 0;