From 9d5703aa0b7d11db3568a2e0aaa462fe2dd98867 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 24 Mar 2022 09:33:44 +0000 Subject: 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 const&) (pdfexport.cxx:1004) Change-Id: I6bc086997851ee06531a4a9ae263e2b26edfba84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132036 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- vcl/source/helper/strhelper.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ) -- cgit