summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-23 16:07:24 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-30 12:45:45 +0100
commitf0a8b5b81d6be08de6e0d504616a1f09830f7c38 (patch)
treec13bfc5e50c8e1852bf50531d6fcdff6e59e718c /comphelper
parent2c8e9ed3cbe3aed5520ce8f5888dd083f8ee50c3 (diff)
move IsFuzzing to comphelper
and try something a bit more generic Change-Id: I1d8256576cd02f0a589df350ba7b53059dd586a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161250 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/configuration.cxx27
1 files changed, 23 insertions, 4 deletions
diff --git a/comphelper/source/misc/configuration.cxx b/comphelper/source/misc/configuration.cxx
index 1ef359c7a9b6..00179ea010da 100644
--- a/comphelper/source/misc/configuration.cxx
+++ b/comphelper/source/misc/configuration.cxx
@@ -183,9 +183,10 @@ css::uno::Any comphelper::detail::ConfigurationWrapper::getPropertyValue(OUStrin
std::scoped_lock aGuard(maMutex);
if (mbDisposed)
throw css::lang::DisposedException();
-#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
- return css::uno::Any();
-#else
+
+ // should be short-circuited in ConfigurationProperty::get()
+ assert(!comphelper::IsFuzzing());
+
// Cache the configuration access, since some of the keys are used in hot code.
auto it = maPropertyCache.find(path);
if( it != maPropertyCache.end())
@@ -201,7 +202,6 @@ css::uno::Any comphelper::detail::ConfigurationWrapper::getPropertyValue(OUStrin
css::uno::Any property = access->getByName(childName);
maPropertyCache.emplace(path, property);
return property;
-#endif
}
void comphelper::detail::ConfigurationWrapper::setPropertyValue(
@@ -332,4 +332,23 @@ void SAL_CALL comphelper::ConfigurationListener::propertyChange(
}
}
+namespace comphelper {
+
+static bool bIsFuzzing = false;
+
+#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
+bool IsFuzzing()
+{
+ return bIsFuzzing;
+}
+#endif
+
+void EnableFuzzing()
+{
+ bIsFuzzing = true;
+ LanguageTag::disable_lt_tag_parse();
+}
+
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */