diff --git a/Python/structmember.c b/Python/structmember.c index 18bd486952419b..c9f03a464078d0 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -208,6 +208,7 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) if (overflow < 0) { PyErr_SetString(PyExc_OverflowError, "Python int too large to convert to C long"); + return -1; } else if (!overflow) { *(unsigned int *)addr = (unsigned int)(unsigned long)long_val; @@ -247,6 +248,7 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) if (overflow < 0) { PyErr_SetString(PyExc_OverflowError, "Python int too large to convert to C long"); + return -1; } else if (!overflow) { *(unsigned long *)addr = (unsigned long)long_val;