vcl/source/helper/strhelper.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 9d5703aa0b7d11db3568a2e0aaa462fe2dd98867
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Mar 24 09:33:44 2022 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Mar 28 11:58:26 2022 +0200

    forcepoint#85 Conditional jump or move depends on uninitialised value
    
    ==398461==    by 0xCDC7960: (anonymous namespace)::CopyUntil(char16_t*&, 
char16_t const*&, char16_t, bool) (strhelper.cxx:88)
    ==398461==    by 0xCDC839F: psp::WhitespaceToSpace(rtl::OUString const&, 
bool) (strhelper.cxx:294)
    ==398461==    by 0xCB54980: vcl::PDFWriterImpl::setOutlineItemText(int, 
rtl::OUString const&) (pdfwriter_impl.cxx:9875)
    ==398461==    by 0xCB547FF: vcl::PDFWriterImpl::createOutlineItem(int, 
rtl::OUString const&, int) (pdfwriter_impl.cxx:9851)
    ==398461==    by 0xCAF39B0: vcl::PDFWriter::CreateOutlineItem(int, 
rtl::OUString const&, int) (pdfwriter.cxx:383)
    ==398461==    by 0xCABD7C8: 
vcl::GlobalSyncData::PlayGlobalActions(vcl::PDFWriter&) 
(pdfextoutdevdata.cxx:250)
    ==398461==    by 0xCAC0628: 
vcl::PDFExtOutDevData::PlayGlobalActions(vcl::PDFWriter&) 
(pdfextoutdevdata.cxx:616)
    ==398461==    by 0x3D06EA0F: PDFExport::Export(rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(pdfexport.cxx:1004)
    
    Change-Id: I6bc086997851ee06531a4a9ae263e2b26edfba84
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132036
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 96e10b4865e8..782c9ce123e1 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -83,7 +83,8 @@ void CopyUntil( sal_Unicode*& pTo, const sal_Unicode*& pFrom, 
sal_Unicode cUntil
             *pTo = *pFrom;
             pTo++;
         }
-        pFrom++;
+        if( *pFrom )
+            pFrom++;
     } while( *pFrom && *pFrom != cUntil );
     // copy the terminating character unless zero or protector
     if( ! isProtect( *pFrom ) || bIncludeUntil )

Reply via email to