diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-03-03 10:20:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-03-03 16:29:15 +0100 |
commit | 94bdee6bf24965fab957c73a2c38e34c115a030e (patch) | |
tree | 0a876077a36c8ed42b1e56f92d87ca292836f26b /sax | |
parent | 0dcd6317f3722f637cd28728fadde595c26d78d9 (diff) |
crashtesting: assert that !rtl::isAscii in xmlError message
probably detected since:
commit 089ce740f9f97f9c7b13e37a31acfc94984e9a3e
Date: Thu Feb 24 17:45:18 2022 +0300
Deduplicate rtl_*String_newConcat*L
or similar
Change-Id: I389d0875463f2ac59fda9266b168bdc35c82de95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130917
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 71b316378e01..2a4961737f9e 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -581,14 +581,8 @@ OUString lclGetErrorMessage( xmlParserCtxtPtr ctxt, std::u16string_view sSystemI pMessage = error->message; else pMessage = "unknown error"; - OUStringBuffer aBuffer( 128 ); - aBuffer.append( "[" ); - aBuffer.append( sSystemId ); - aBuffer.append( " line " ); - aBuffer.append( nLine ); - aBuffer.append( "]: " ); - aBuffer.appendAscii( pMessage ); - return aBuffer.makeStringAndClear(); + return OUString::Concat("[") + sSystemId + " line " + OUString::number(nLine) + "]: " + + OUString(pMessage, strlen(pMessage), RTL_TEXTENCODING_ASCII_US); } // throw an exception, but avoid callback if |