[Python-checkins] cpython (merge 3.3 -> default): Add missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()

christian.heimes python-checkins at python.org
Sat Jul 20 14:48:43 CEST 2013


http://hg.python.org/cpython/rev/29c6fe41e7f1
changeset:   84727:29c6fe41e7f1
parent:      84725:a65856044ad4
parent:      84726:13d5b245ca14
user:        Christian Heimes <christian at cheimes.de>
date:        Sat Jul 20 14:48:21 2013 +0200
summary:
  Add missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()
CID 486647

files:
  Python/ceval.c |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3461,7 +3461,9 @@
                          keyword);
             goto fail;
         }
-        PyDict_SetItem(kwdict, keyword, value);
+        if (PyDict_SetItem(kwdict, keyword, value) == -1) {
+            goto fail;
+        }
         continue;
       kw_found:
         if (GETLOCAL(j) != NULL) {

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list