Fix UBSAN error with function argument casting. (#362)

This commit is contained in:
Abhishek Arya 2017-02-07 15:28:57 -08:00 committed by GitHub
parent 0854c71ab4
commit 6bbfc0b62f
2 changed files with 4 additions and 4 deletions

View File

@ -19,10 +19,10 @@
#include <plist/plist.h>
#include <stdio.h>
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<const char*>(data), size, &root_node);
plist_free(root_node);
return 0;

View File

@ -19,10 +19,10 @@
#include <plist/plist.h>
#include <stdio.h>
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<const char*>(data), size, &root_node);
plist_free(root_node);
return 0;