summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--external/pdfium/ubsan.patch9
1 files changed, 9 insertions, 0 deletions
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);