[Python-checkins] bpo-32571: Fix reading uninitialized memory (GH-5332)

INADA Naoki webhook-mailer at python.org
Fri Jan 26 02:22:54 EST 2018


https://github.com/python/cpython/commit/e76daebc0c8afa3981a4c5a8b54537f756e805de
commit: e76daebc0c8afa3981a4c5a8b54537f756e805de
branch: master
author: INADA Naoki <methane at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-01-26T16:22:51+09:00
summary:

bpo-32571: Fix reading uninitialized memory (GH-5332)

Reported by Coverity Scan.

files:
M Objects/object.c

diff --git a/Objects/object.c b/Objects/object.c
index 7b2adbea1a1..fef57fce7ba 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;
     }



More information about the Python-checkins mailing list