external/pdfium/ubsan.patch | 9 +++++++++ 1 file changed, 9 insertions(+)
New commits: commit a3351e6bf7f637632cc436071da2619841fb8287 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Oct 11 11:18:17 2022 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Oct 11 15:25:31 2022 +0200 Avoid UBSan invalid-null-argument ...as seen at least with --without-latest-c++ after d0b2f5f65e80a4262425bb87d5716d7b4341dfea "pdfium: drop not needed annot.patch.1" during CppunitTest_sw_core_text, > workdir/UnpackedTarball/pdfium/core/fxcrt/string_data_template.cpp:76:20: runtime error: null pointer passed as argument 2, which is declared to never be null > /usr/include/string.h:44:28: note: nonnull attribute specified here > #0 in fxcrt::StringDataTemplate<char>::CopyContents(char const*, unsigned long) at workdir/UnpackedTarball/pdfium/core/fxcrt/string_data_template.cpp:76:3 > #1 in fxcrt::ByteString::ByteString(fxcrt::StringViewTemplate<char>, fxcrt::StringViewTemplate<char>) at workdir/UnpackedTarball/pdfium/core/fxcrt/bytestring.cpp:160:12 > #2 in fxcrt::operator+(fxcrt::ByteString const&, fxcrt::ByteString const&) at workdir/UnpackedTarball/pdfium/core/fxcrt/bytestring.h:265:10 > #3 in CPDFSDK_AppStream::SetAsTextField(absl::optional<fxcrt::WideString>) at workdir/UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_appstream.cpp:1805:34 > #4 in CPDFSDK_Widget::ResetAppearance(absl::optional<fxcrt::WideString>, CPDFSDK_Widget::ValueChanged) at workdir/UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widget.cpp:655:17 > #5 in CPDFSDK_PageView::NewAnnot(CPDF_Annot*) at workdir/UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_pageview.cpp:108:12 > #6 in CPDFSDK_PageView::LoadFXAnnots() at workdir/UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_pageview.cpp:566:45 > #7 in CPDFSDK_FormFillEnvironment::GetOrCreatePageView(IPDF_Page*) at workdir/UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_formfillenvironment.cpp:625:14 > #8 in (anonymous namespace)::FormHandleToPageView(fpdf_form_handle_t__*, fpdf_page_t__*) at workdir/UnpackedTarball/pdfium/fpdfsdk/fpdf_formfill.cpp:169:39 > #9 in FORM_OnAfterLoadPage at workdir/UnpackedTarball/pdfium/fpdfsdk/fpdf_formfill.cpp:730:37 > #10 in vcl::pdf::(anonymous namespace)::PDFiumPageImpl::onAfterLoadPage(vcl::pdf::PDFiumDocument*) at vcl/source/pdf/PDFiumLibrary.cxx:764:5 > #11 in testContentControlPDFFont::TestBody() at sw/qa/core/text/text.cxx:746:12 Change-Id: Iba73a9401eb10a8c03843dba038cd3a6eeeb0c4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141210 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch index bc9868244275..f1d3552b20d2 100644 --- a/external/pdfium/ubsan.patch +++ b/external/pdfium/ubsan.patch @@ -1,5 +1,14 @@ --- core/fxcrt/string_data_template.cpp +++ core/fxcrt/string_data_template.cpp +@@ -73,7 +73,7 @@ + size_t nLen) { + DCHECK_GE(nLen, 0); + DCHECK_LE(nLen, m_nAllocLength); +- memcpy(m_String, pStr, nLen * sizeof(CharType)); ++ if (nLen != 0) memcpy(m_String, pStr, nLen * sizeof(CharType)); + m_String[nLen] = 0; + } + @@ -82,7 +82,8 @@ void StringDataTemplate<CharType>::CopyContentsAt(size_t offset, DCHECK_GE(offset, 0); DCHECK_GE(nLen, 0);