From: INADA Naoki Date: Fri, 26 Jan 2018 07:22:51 +0000 (+0900) Subject: bpo-32571: Fix reading uninitialized memory (GH-5332) X-Git-Tag: v3.7.0b1~96 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e76daebc0c8afa3981a4c5a8b54537f756e805de;p=thirdparty%2FPython%2Fcpython.git bpo-32571: Fix reading uninitialized memory (GH-5332) Reported by Coverity Scan. --- diff --git a/Objects/object.c b/Objects/object.c index 7b2adbea1a1f..fef57fce7ba7 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -917,6 +917,11 @@ _PyObject_LookupAttr(PyObject *v, PyObject *name, PyObject **result) } *result = (*tp->tp_getattr)(v, (char *)name_str); } + else { + *result = NULL; + return 0; + } + if (*result != NULL) { return 1; }