diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index cd981b8d1a87..1e9c2dbbc192 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -17,6 +17,8 @@ #include #include +#include + #include #include #include @@ -1364,7 +1366,9 @@ void cppuhelper::ServiceManager::readRdbFile( static_cast< cppu::OWeakObject * >(this)); } SAL_INFO("cppuhelper", "Ignored optional " << uri); - } catch (css::registry::InvalidRegistryException & e) { + } +#if !ENABLE_FUZZERS + catch (css::registry::InvalidRegistryException & e) { if (!readLegacyRdbFile(uri)) { throw css::uno::DeploymentException( "InvalidRegistryException: " + e.Message, @@ -1375,8 +1379,10 @@ void cppuhelper::ServiceManager::readRdbFile( throw; } } +#endif } +#if !ENABLE_FUZZERS bool cppuhelper::ServiceManager::readLegacyRdbFile(OUString const & uri) { Registry reg; switch (reg.open(uri, RegAccessMode::READONLY)) { @@ -1511,6 +1517,7 @@ void cppuhelper::ServiceManager::readLegacyRdbStrings( strings->push_back(names.getElement(i).copy(prefix.getLength())); } } +#endif void cppuhelper::ServiceManager::insertRdbFiles( std::vector< OUString > const & uris, diff --git a/unoidl/Library_unoidl.mk b/unoidl/Library_unoidl.mk index ff37972eec96..4b3dba1b5ab8 100644 --- a/unoidl/Library_unoidl.mk +++ b/unoidl/Library_unoidl.mk @@ -12,13 +12,19 @@ $(eval $(call gb_Library_Library,unoidl)) $(eval $(call gb_Library_add_defs,unoidl,-DLO_DLLIMPLEMENTATION_UNOIDL)) $(eval $(call gb_Library_add_exception_objects,unoidl, \ - unoidl/source/legacyprovider \ unoidl/source/sourcefileprovider \ unoidl/source/sourcetreeprovider \ unoidl/source/unoidl \ unoidl/source/unoidlprovider \ )) +# drop legacy provider for fuzzing +ifeq (,$(filter FUZZERS,$(BUILD_TYPE))) +$(eval $(call gb_Library_add_exception_objects,unoidl, \ + unoidl/source/legacyprovider \ +)) +endif + $(eval $(call gb_Library_add_grammars,unoidl, \ unoidl/source/sourceprovider-parser \ )) diff --git a/unoidl/source/unoidl.cxx b/unoidl/source/unoidl.cxx index 2022bcd058ac..acf984613420 100644 --- a/unoidl/source/unoidl.cxx +++ b/unoidl/source/unoidl.cxx @@ -14,6 +14,8 @@ #include #include +#include + #include #include #include @@ -21,7 +23,9 @@ #include #include +#if !ENABLE_FUZZERS #include "legacyprovider.hxx" +#endif #include "sourcefileprovider.hxx" #include "sourcetreeprovider.hxx" #include "unoidlprovider.hxx" @@ -211,11 +215,16 @@ rtl::Reference< Provider > Manager::loadProvider(OUString const & uri) { try { return new detail::UnoidlProvider(uri); } catch (FileFormatException & e) { +#if !ENABLE_FUZZERS SAL_INFO( "unoidl", "FileFormatException \"" << e.getDetail() << "\", retrying <" << uri << "> as legacy format"); return new detail::LegacyProvider(*this, uri); +#else + (void)e; + return nullptr; +#endif } } diff --git a/vcl/commonfuzzer.mk b/vcl/commonfuzzer.mk index 476a68adb0a4..cca33194e9bc 100644 --- a/vcl/commonfuzzer.mk +++ b/vcl/commonfuzzer.mk @@ -148,8 +148,6 @@ fuzzer_core_libraries = \ i18nlangtag \ xmlreader \ unoidl \ - reg \ - store \ gcc3_uno \ salhelper \ sal \