summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-05 21:29:35 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-03-06 13:36:42 +0100
commitffa0dedf93d913536488bc1718f855e6ff48284b (patch)
treec49f873d60bee749cc86931bf90eae9c29f4155f /unoxml
parent06bd8d70ea06679c992f110c7a29fe045733e306 (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: I69ac57bd5718a4da85516e2a2afa79dc2b04665e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131068 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/source/dom/documentbuilder.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx
index 3da15ee7d7e9..8139a4c7d8f1 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -138,14 +138,11 @@ namespace DOM
static OUString make_error_message(xmlParserCtxtPtr ctxt)
{
- OUStringBuffer buf;
- buf.appendAscii(ctxt->lastError.message);
- buf.append("Line: ");
- buf.append(static_cast<sal_Int32>(ctxt->lastError.line));
- buf.append("\nColumn: ");
- buf.append(static_cast<sal_Int32>(ctxt->lastError.int2));
- OUString msg = buf.makeStringAndClear();
- return msg;
+ return OUString(ctxt->lastError.message, strlen(ctxt->lastError.message), RTL_TEXTENCODING_ASCII_US) +
+ "Line: " +
+ OUString::number(static_cast<sal_Int32>(ctxt->lastError.line)) +
+ "\nColumn: " +
+ OUString::number(static_cast<sal_Int32>(ctxt->lastError.int2));
}
// -- callbacks and context struct for parsing from stream