[Libreoffice-commits] core.git: external/pdfium
Stephan Bergmann
sbergman at redhat.com
Mon Nov 20 15:03:46 UTC 2017
external/pdfium/ubsan.patch | 12 ++++++++++++
1 file changed, 12 insertions(+)
New commits:
commit 145a3a0c449e2c6186c10a4a1ca659e7415b177a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Nov 20 16:00:48 2017 +0100
external/pdfium: -fsanitize=nonnull-attribute
...as seen during CppunitTest_vcl_pdfexport:
> workdir/UnpackedTarball/pdfium/core/fxcrt/string_data_template.h:81:31: 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 0x7f6506471c0d in fxcrt::StringDataTemplate<char>::CopyContentsAt(unsigned long, char const*, unsigned long) workdir/UnpackedTarball/pdfium/core/fxcrt/string_data_template.h:81:5
> #1 0x7f650645f9db in fxcrt::ByteString::ByteString(fxcrt::StringViewTemplate<char> const&, fxcrt::StringViewTemplate<char> const&) workdir/UnpackedTarball/pdfium/core/fxcrt/bytestring.cpp:137:12
> #2 0x7f6505e6bfbc in fxcrt::operator+(char const*, fxcrt::ByteString const&) workdir/UnpackedTarball/pdfium/core/fxcrt/bytestring.h:242:10
> #3 0x7f650671798c in CFX_FolderFontInfo::ReportFace(fxcrt::ByteString const&, _IO_FILE*, unsigned int, unsigned int) workdir/UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo.cpp:223:21
> #4 0x7f6506716ea1 in CFX_FolderFontInfo::ScanFile(fxcrt::ByteString const&) workdir/UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo.cpp:193:5
> #5 0x7f65067154fb in CFX_FolderFontInfo::ScanPath(fxcrt::ByteString const&) workdir/UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo.cpp:151:36
> #6 0x7f650671546a in CFX_FolderFontInfo::ScanPath(fxcrt::ByteString const&) workdir/UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo.cpp:151:15
> #7 0x7f6506714c86 in CFX_FolderFontInfo::EnumFontList(CFX_FontMapper*) workdir/UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo.cpp:121:5
> #8 0x7f650676d271 in CFX_FontMapper::LoadInstalledFonts() workdir/UnpackedTarball/pdfium/core/fxge/cfx_fontmapper.cpp:360:16
> #9 0x7f650676d469 in CFX_FontMapper::MatchInstalledFonts(fxcrt::ByteString const&) workdir/UnpackedTarball/pdfium/core/fxge/cfx_fontmapper.cpp:365:3
> #10 0x7f6506773376 in CFX_FontMapper::FindSubstFont(fxcrt::ByteString const&, bool, unsigned int, int, int, int, CFX_SubstFont*) workdir/UnpackedTarball/pdfium/core/fxge/cfx_fontmapper.cpp:573:22
[...]
Change-Id: I0221a099198d8f23f239e8493509bdf1816fbc59
diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch
index 8e7ac71b7b8d..7e4e2e9276a8 100644
--- a/external/pdfium/ubsan.patch
+++ b/external/pdfium/ubsan.patch
@@ -9,6 +9,18 @@
BMPDecompressor m_Bmp;
UnownedPtr<CCodec_BmpModule> const m_pModule;
+--- core/fxcrt/string_data_template.h
++++ core/fxcrt/string_data_template.h
+@@ -78,7 +78,8 @@
+
+ void CopyContentsAt(size_t offset, const CharType* pStr, size_t nLen) {
+ ASSERT(offset >= 0 && nLen >= 0 && offset + nLen <= m_nAllocLength);
+- memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
++ if (nLen != 0)
++ memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
+ m_String[offset + nLen] = 0;
+ }
+
--- core/fxge/cfx_facecache.cpp
+++ core/fxge/cfx_facecache.cpp
@@ -223,7 +223,8 @@ std::unique_ptr<CFX_GlyphBitmap> CFX_FaceCache::RenderGlyph(
More information about the Libreoffice-commits
mailing list