unoxml/source/dom/documentbuilder.cxx |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit ffa0dedf93d913536488bc1718f855e6ff48284b
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Mar 5 21:29:35 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Mar 6 13:36:42 2022 +0100

    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 <caol...@redhat.com>

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

Reply via email to