diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-05-02 20:29:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-05-03 09:46:23 +0200 |
commit | 4e1cf8411197b4c11a6c5d4728e047e6d46567b5 (patch) | |
tree | 3033f083b4b868000b99b3412aad91ab9b30a1c2 | |
parent | ddef1e2c017b7d8e421dedc1a0ce722ff4208985 (diff) |
ofz#47198 Use-of-uninitialized-value
seen in ww8 filter with rName of length 0 in if (rName.startsWithIgnoreAsciiCase("Tms Rmn")
Change-Id: Ia8a20971161a44d62ead9bfcef59f86b007fd58b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133713
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/rtl/ustring.hxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index ca061328d5a4..b7cebaf90647 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -1526,7 +1526,9 @@ public: assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); bool b - = (rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths( + = (libreoffice_internal::ConstCharArrayDetector<T>::length + <= sal_uInt32(pData->length)) + && (rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths( pData->buffer, libreoffice_internal::ConstCharArrayDetector<T>::length, libreoffice_internal::ConstCharArrayDetector<T>::toPointer( |