Kaydet (Commit) 02effc8e authored tarafından Caolán McNamara's avatar Caolán McNamara

ubsan failure on bootstrapping crashtesting

Change-Id: Ie2b338bdd75f26953c758b64711e60b6f5ce9c83
üst daa6fe41
...@@ -62,3 +62,18 @@ ...@@ -62,3 +62,18 @@
Py_INCREF(v); Py_INCREF(v);
#ifdef COUNT_ALLOCS #ifdef COUNT_ALLOCS
if (ival >= 0) 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) {
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