[Libreoffice-commits] core.git: external/icu
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Tue May 12 14:38:29 UTC 2020
external/icu/ubsan.patch | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
New commits:
commit fdf5bb5001422941e9d43e34ce88243e0e52109c
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue May 12 12:11:59 2020 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue May 12 16:37:47 2020 +0200
external/icu: Silence UBSan invalid-null-argument
...as seen during CppunitTest_i18npool_test_ordinalsuffix:
> uloc.cpp:1206:5: runtime error: null pointer passed as argument 1, which is declared to never be null
> /usr/include/string.h:44:28: note: nonnull attribute specified here
> #0 in ulocimp_getLanguage_67 at workdir/UnpackedTarball/icu/source/common/uloc.cpp:1206:5
> #1 in uloc_getCountry_67 at workdir/UnpackedTarball/icu/source/common/uloc.cpp:1803:5
> #2 in ulocimp_getRegionForSupplementalData_67 at workdir/UnpackedTarball/icu/source/common/loclikely.cpp:1334:17
> #3 in idForLocale(char const*, char*, int, UErrorCode*) at workdir/UnpackedTarball/icu/source/common/ucurr.cpp:350:5
> #4 in ucurr_forLocale_67 at workdir/UnpackedTarball/icu/source/common/ucurr.cpp:535:5
> #5 in icu_67::DecimalFormatSymbols::initialize(icu_67::Locale const&, UErrorCode&, signed char, icu_67::NumberingSystem const*) at workdir/UnpackedTarball/icu/source/i18n/dcfmtsym.cpp:461:29
> #6 in icu_67::DecimalFormatSymbols::DecimalFormatSymbols(icu_67::Locale const&, UErrorCode&) at workdir/UnpackedTarball/icu/source/i18n/dcfmtsym.cpp:110:5
> #7 in icu_67::RuleBasedNumberFormat::initializeDecimalFormatSymbols(UErrorCode&) at workdir/UnpackedTarball/icu/source/i18n/rbnf.cpp:1854:53
> #8 in icu_67::RuleBasedNumberFormat::init(icu_67::UnicodeString const&, icu_67::LocalizationInfo*, UParseError&, UErrorCode&) at workdir/UnpackedTarball/icu/source/i18n/rbnf.cpp:1488:5
> #9 in icu_67::RuleBasedNumberFormat::RuleBasedNumberFormat(icu_67::URBNFRuleSetTag, icu_67::Locale const&, UErrorCode&) at workdir/UnpackedTarball/icu/source/i18n/rbnf.cpp:867:9
> #10 in i18npool::OrdinalSuffixService::getOrdinalSuffix(int, com::sun::star::lang::Locale const&) at i18npool/source/ordinalsuffix/ordinalsuffix.cxx:79:32
> #11 in non-virtual thunk to i18npool::OrdinalSuffixService::getOrdinalSuffix(int, com::sun::star::lang::Locale const&) at i18npool/source/ordinalsuffix/ordinalsuffix.cxx
> #12 in TestOrdinalSuffix::testFrench() at i18npool/qa/cppunit/test_ordinalsuffix.cxx:53:29
etc.
Change-Id: I4a87ee36fd33791c3906d6b6adc72ec824c4b3ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94047
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/external/icu/ubsan.patch b/external/icu/ubsan.patch
index 9acae66465d4..762bd6e5ae15 100644
--- a/external/icu/ubsan.patch
+++ b/external/icu/ubsan.patch
@@ -1,3 +1,25 @@
+--- source/common/uloc.cpp
++++ source/common/uloc.cpp
+@@ -1203,7 +1203,8 @@
+ return 0;
+ }
+ int32_t reslen = result.length();
+- uprv_memcpy(language, result.data(), std::min(reslen, languageCapacity));
++ auto const n = std::min(reslen, languageCapacity);
++ if (n != 0) uprv_memcpy(language, result.data(), n);
+ return reslen;
+ }
+
+@@ -1251,7 +1252,8 @@
+ return 0;
+ }
+ int32_t reslen = result.length();
+- uprv_memcpy(script, result.data(), std::min(reslen, scriptCapacity));
++ auto const n = std::min(reslen, scriptCapacity);
++ if (n != 0) uprv_memcpy(script, result.data(), n);
+ return reslen;
+ }
+
--- source/tools/genrb/rbutil.c
+++ source/tools/genrb/rbutil.c
@@ -30,7 +30,12 @@
More information about the Libreoffice-commits
mailing list