Kaydet (Commit) 145a3a0c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 1a4277c5
...@@ -9,6 +9,18 @@ ...@@ -9,6 +9,18 @@
BMPDecompressor m_Bmp; BMPDecompressor m_Bmp;
UnownedPtr<CCodec_BmpModule> const m_pModule; 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
+++ core/fxge/cfx_facecache.cpp +++ core/fxge/cfx_facecache.cpp
@@ -223,7 +223,8 @@ std::unique_ptr<CFX_GlyphBitmap> CFX_FaceCache::RenderGlyph( @@ -223,7 +223,8 @@ std::unique_ptr<CFX_GlyphBitmap> CFX_FaceCache::RenderGlyph(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment