From: Serhiy Storchaka Date: Sun, 4 Feb 2024 17:06:22 +0000 (+0200) Subject: gh-114388: Fix an error in GH-114391 (GH-115000) X-Git-Tag: v3.13.0a4~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d466052ad48091a00a50c5298f33238aff591028;p=thirdparty%2FPython%2Fcpython.git gh-114388: Fix an error in GH-114391 (GH-115000) --- diff --git a/Python/structmember.c b/Python/structmember.c index 18bd48695241..c9f03a464078 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;