summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
Diffstat (limited to 'external')
-rw-r--r--external/python3/ubsan.patch.015
1 files changed, 15 insertions, 0 deletions
diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0
index 32a079e04a01..e3798174baa0 100644
--- a/external/python3/ubsan.patch.0
+++ b/external/python3/ubsan.patch.0
@@ -62,3 +62,18 @@
Py_INCREF(v);
#ifdef COUNT_ALLOCS
if (ival >= 0)
+--- Modules/_ctypes/_ctypes.c
++++ Modules/_ctypes/_ctypes.c
+@@ -1328,8 +1328,10 @@
+ if (stgdict->shape == NULL)
+ goto error;
+ stgdict->shape[0] = length;
+- memmove(&stgdict->shape[1], itemdict->shape,
+- sizeof(Py_ssize_t) * (stgdict->ndim - 1));
++ if (itemdict->shape) {
++ memmove(&stgdict->shape[1], itemdict->shape,
++ sizeof(Py_ssize_t) * (stgdict->ndim - 1));
++ }
+
+ itemsize = itemdict->size;
+ if (length * itemsize < 0) {