summaryrefslogtreecommitdiffstats
path: root/external/pdfium/ubsan.patch
diff options
context:
space:
mode:
Diffstat (limited to 'external/pdfium/ubsan.patch')
-rw-r--r--external/pdfium/ubsan.patch8
1 files changed, 4 insertions, 4 deletions
diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch
index cd48b3ee4803..bc9868244275 100644
--- a/external/pdfium/ubsan.patch
+++ b/external/pdfium/ubsan.patch
@@ -1,9 +1,9 @@
--- core/fxcrt/string_data_template.cpp
+++ core/fxcrt/string_data_template.cpp
-@@ -83,7 +83,8 @@ void StringDataTemplate<CharType>::CopyContentsAt(size_t offset,
- DCHECK(nLen >= 0);
- DCHECK(offset + nLen <= m_nAllocLength);
-
+@@ -82,7 +82,8 @@ void StringDataTemplate<CharType>::CopyContentsAt(size_t offset,
+ DCHECK_GE(offset, 0);
+ DCHECK_GE(nLen, 0);
+ DCHECK_LE(offset + nLen, m_nAllocLength);
- memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
+ if (nLen != 0)
+ memcpy(m_String + offset, pStr, nLen * sizeof(CharType));