summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-21 22:57:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-22 07:19:30 +0200
commitad53c152cc1b79f9a64fffcff766e0fa29c3e287 (patch)
tree11ea1d90fc3f85438513bf28b81fac6075667973 /external
parent0c3e90d95c2c952265625bcff590599627114ec1 (diff)
external/expat: Avoid -fsanitizenullptr-with-offset
...(new with Clang 10 trunk), where adding even an offset of 0 to a null pointer is UB in C. Seen when building CustomTarget_writerfilter/source: > [PY ] CustomTarget/writerfilter/source/ooxml/resourceids.hxx > workdir/UnpackedTarball/expat/lib/xmlparse.c:6488:23: runtime error: applying zero offset to null pointer > #0 in hashTableIterInit at workdir/UnpackedTarball/expat/lib/xmlparse.c:6488:23 > #1 in dtdDestroy at workdir/UnpackedTarball/expat/lib/xmlparse.c:6130:3 > #2 in XML_ParserFree at workdir/UnpackedTarball/expat/lib/xmlparse.c:1368:5 > #3 in xmlparse_dealloc at workdir/UnpackedTarball/python3/Modules/pyexpat.c:1222:9 > #4 in insertdict at workdir/UnpackedTarball/python3/Objects/dictobject.c:807:9 > #5 in _PyObjectDict_SetItem at workdir/UnpackedTarball/python3/Objects/dictobject.c:3927:19 > #6 in _PyObject_GenericSetAttrWithDict at workdir/UnpackedTarball/python3/Objects/object.c:1159:19 > #7 in PyObject_SetAttr at workdir/UnpackedTarball/python3/Objects/object.c:930:15 > #8 in PyEval_EvalFrameEx at workdir/UnpackedTarball/python3/Python/ceval.c:2310:19 [...] Change-Id: I152ddb20c726dbeb638c5fab4403423f5c6da7b5 Reviewed-on: https://gerrit.libreoffice.org/81284 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/expat/UnpackedTarball_expat.mk1
-rw-r--r--external/expat/ubsan.patch.011
2 files changed, 12 insertions, 0 deletions
diff --git a/external/expat/UnpackedTarball_expat.mk b/external/expat/UnpackedTarball_expat.mk
index 5d4f41f6d147..96f4e3ec8732 100644
--- a/external/expat/UnpackedTarball_expat.mk
+++ b/external/expat/UnpackedTarball_expat.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,expat,conftools))
$(eval $(call gb_UnpackedTarball_add_patches,expat,\
external/expat/expat-winapi.patch \
+ external/expat/ubsan.patch.0 \
))
# This is a bit hackish.
diff --git a/external/expat/ubsan.patch.0 b/external/expat/ubsan.patch.0
new file mode 100644
index 000000000000..8317f922df88
--- /dev/null
+++ b/external/expat/ubsan.patch.0
@@ -0,0 +1,11 @@
+--- lib/xmlparse.c
++++ lib/xmlparse.c
+@@ -6485,7 +6485,7 @@
+ static void FASTCALL
+ hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) {
+ iter->p = table->v;
+- iter->end = iter->p + table->size;
++ iter->end = table->size == 0 ? iter->p : iter->p + table->size;
+ }
+
+ static NAMED *FASTCALL