diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-17 20:23:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-17 21:50:46 +0000 |
commit | f52118159e1e958177aa8080d9b43962d31bbdfd (patch) | |
tree | 52f8add6c57b3187c12a5eedce88ffd593c559ce /oox | |
parent | 2b6d04b8493a6b05c8ed0afb0c1e96d441ba876b (diff) |
crashtesting: assert on export of forum-mso-en4-212378.xlsx back to xlsx
input xml contains:
<cellStyle name="ck-In_xdc80_.."
resulting in a bare low surrogate that asserts on export's OUString::toUtf8()
Sanitize it at the original import
Change-Id: Ib1259ed55090efb16e1c5b4b488bf3050e473324
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144389
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/helper/attributelist.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index e950ee5ea490..49ff32a967f5 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -19,6 +19,7 @@ #include <oox/helper/attributelist.hxx> +#include <comphelper/string.hxx> #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> #include <sax/fastattribs.hxx> @@ -102,7 +103,7 @@ OUString AttributeConversion::decodeXString( const OUString& rValue ) const sal_Unicode* pcEnd = pcStr + rValue.getLength(); while( pcStr < pcEnd ) aBuffer.append( lclGetXChar( pcStr, pcEnd ) ); - return aBuffer.makeStringAndClear(); + return comphelper::string::sanitizeStringSurrogates(aBuffer.makeStringAndClear()); } sal_Int32 AttributeConversion::decodeInteger( std::u16string_view rValue ) |