forms/source/misc/limitedformats.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 47f523e17d54d2a0074e39c9bd2a32c266b74a9f Author: Caolán McNamara <[email protected]> AuthorDate: Wed Jul 17 14:49:13 2024 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Jul 18 00:54:23 2024 +0200 cid#1608071 Out-of-bounds access Change-Id: Ia258bb10c015150f3ff8f978e975a033e981aa92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170633 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 2a20a894b0752e5b7f28547ed9a90570739e8bea) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170650 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx index e899128aa5e8..c40de6b23430 100644 --- a/forms/source/misc/limitedformats.cxx +++ b/forms/source/misc/limitedformats.cxx @@ -18,6 +18,7 @@ */ #include <limitedformats.hxx> +#include <sal/log.hxx> #include <osl/diagnose.h> #include <comphelper/types.hxx> #include <comphelper/extract.hxx> @@ -266,6 +267,11 @@ namespace frm Any aEnumPropertyValue = m_xAggregate->getFastPropertyValue(m_nFormatEnumPropertyHandle); sal_Int32 nOldEnumValue = -1; ::cppu::enum2int(nOldEnumValue, aEnumPropertyValue); + if (nOldEnumValue < 0) + { + SAL_WARN("forms.misc", "Negative OldEnumValue!"); + return false; + } // get the translation table std::span<FormatEntry> pFormats = lcl_getFormatTable(m_nTableId);
