From 5273c680d17fa386a844d3bbffd20b6a8bd354a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 8 Oct 2017 20:49:47 +0100 Subject: [PATCH] knock 200M off wmf fuzzer Change-Id: I78f642071eb2dbcb5127d7df5839dfade158cac9 --- vcl/Executable_wmffuzzer.mk | 1 - vcl/workben/wmffuzzer.cxx | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/vcl/Executable_wmffuzzer.mk b/vcl/Executable_wmffuzzer.mk index bfebcfb9f394..7e277e0aea33 100644 --- a/vcl/Executable_wmffuzzer.mk +++ b/vcl/Executable_wmffuzzer.mk @@ -33,7 +33,6 @@ $(eval $(call gb_Executable_use_libraries,wmffuzzer,\ $(eval $(call gb_Executable_use_static_libraries,wmffuzzer,\ findsofficepath \ ulingu \ - fuzzer_core \ fuzzerstubs \ )) diff --git a/vcl/workben/wmffuzzer.cxx b/vcl/workben/wmffuzzer.cxx index 1a05174e7502..b6ea0b593c86 100644 --- a/vcl/workben/wmffuzzer.cxx +++ b/vcl/workben/wmffuzzer.cxx @@ -12,6 +12,40 @@ #include #include "commonfuzzer.hxx" +#include +#include + +extern "C" { +void * emfio_component_getFactory( const char* , void* , void* ); +void * com_sun_star_i18n_LocaleDataImpl_get_implementation( void *, void * ); +void * com_sun_star_i18n_BreakIterator_Unicode_get_implementation( void *, void * ); +void * com_sun_star_i18n_BreakIterator_get_implementation( void *, void * ); +} + +const lib_to_factory_mapping * +lo_get_factory_map(void) +{ + static lib_to_factory_mapping map[] = { + { "libemfiolo.a", emfio_component_getFactory }, + { 0, 0 } + }; + + return map; +} + +const lib_to_constructor_mapping * +lo_get_constructor_map(void) +{ + static lib_to_constructor_mapping map[] = { + { "com_sun_star_i18n_LocaleDataImpl_get_implementation", com_sun_star_i18n_LocaleDataImpl_get_implementation }, + { "com_sun_star_i18n_BreakIterator_Unicode_get_implementation", com_sun_star_i18n_BreakIterator_Unicode_get_implementation }, + { "com_sun_star_i18n_BreakIterator_get_implementation", com_sun_star_i18n_BreakIterator_get_implementation }, + { 0, 0 } + }; + + return map; +} + extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { TypicalFuzzerInitialize(argc, argv);