diff -NarU5 a/Include/pymem.h b/Include/pymem.h --- a/Include/pymem.h 2016-12-17 15:05:05.000000000 -0500 +++ b/Include/pymem.h 2017-07-20 15:10:18.655330317 -0400 @@ -70,13 +70,13 @@ would return a pointer with no memory behind it, which would break pymalloc. To solve these problems, allocate an extra byte. */ /* Returns NULL to indicate error if a negative size or size larger than Py_ssize_t can represent is supplied. Helps prevents security holes. */ #define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \ - : malloc((n) ? (n) : 1)) + : malloc((n) > 0 ? (n) : 1)) #define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \ - : realloc((p), (n) ? (n) : 1)) + : realloc((p), (n) > 0 ? (n) : 1)) #define PyMem_FREE free #endif /* PYMALLOC_DEBUG */ /*