[Libreoffice-commits] core.git: filter/source vcl/Executable_epsfuzzer.mk vcl/workben
Caolán McNamara
caolanm at redhat.com
Sun Oct 15 22:25:26 UTC 2017
filter/source/graphicfilter/ieps/ieps.cxx | 5 +++-
vcl/Executable_epsfuzzer.mk | 1
vcl/workben/epsfuzzer.cxx | 32 ++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 2 deletions(-)
New commits:
commit 9bb9be2ab19a959e5fd602a9a532317d3c086723
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Oct 15 20:53:06 2017 +0100
reduce eps fuzzer size
and ofz+ubsan warning
Change-Id: I55db222dc73432171d9d0b8b8e41371963ccb955
Reviewed-on: https://gerrit.libreoffice.org/43412
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index b74f0805bab2..f2b138f550cd 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -36,6 +36,7 @@
#include <osl/file.hxx>
#include <osl/thread.h>
#include <o3tl/char16_t2wchar_t.hxx>
+#include <o3tl/safeint.hxx>
#include <memory>
class FilterConfigItem;
@@ -96,7 +97,9 @@ static long ImplGetNumber(sal_uInt8* &rBuf, sal_uInt32& nSecurityCount)
nSecurityCount = 1; // error parsing the bounding box values
else if ( bValid )
{
- nRetValue *= 10;
+ const bool bFail = o3tl::checked_multiply(nRetValue, 10L, nRetValue);
+ if (bFail)
+ return 0;
nRetValue += *rBuf - '0';
}
break;
diff --git a/vcl/Executable_epsfuzzer.mk b/vcl/Executable_epsfuzzer.mk
index cc5c3a483bbc..2851b43ad6af 100644
--- a/vcl/Executable_epsfuzzer.mk
+++ b/vcl/Executable_epsfuzzer.mk
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_use_libraries,epsfuzzer,\
$(eval $(call gb_Executable_use_static_libraries,epsfuzzer,\
findsofficepath \
ulingu \
- fuzzer_core \
fuzzerstubs \
))
diff --git a/vcl/workben/epsfuzzer.cxx b/vcl/workben/epsfuzzer.cxx
index 1cc1c9fe8f5e..3105bf76dcc5 100644
--- a/vcl/workben/epsfuzzer.cxx
+++ b/vcl/workben/epsfuzzer.cxx
@@ -11,6 +11,38 @@
#include <vcl/FilterConfigItem.hxx>
#include "commonfuzzer.hxx"
+#include <config_features.h>
+#include <osl/detail/component-mapping.h>
+
+extern "C" {
+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[] = {
+ { 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" bool ipsGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
More information about the Libreoffice-commits
mailing list