diff --git a/options/m_property.c b/options/m_property.c index eb3f78e847..94e2d18a3b 100644 --- a/options/m_property.c +++ b/options/m_property.c @@ -293,6 +293,9 @@ char *m_properties_expand_string(const struct m_property *prop_list, bool skip = false; int level = 0, skip_level = 0; bstr str = bstr0(str0); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + int n = 0; +#endif while (str.len) { if (level > 0 && bstr_eatstart0(&str, "}")) { @@ -311,6 +314,10 @@ char *m_properties_expand_string(const struct m_property *prop_list, bool have_fallback = bstr_eatstart0(&str, ":"); if (!skip) { +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + if (n++ > 10) + break; +#endif skip = expand_property(prop_list, &ret, &ret_len, name, have_fallback, ctx); if (skip)