diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-07-02 14:22:13 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-07-02 14:22:13 (GMT) |
commit | 9d872e19aac7f09d9b127936427d998bd1e3170c (patch) | |
tree | d6ccda393be72cc9bda6ec7f308488145ca7a3bc /Python | |
parent | 723585bbaf5a4c83d187c7868790cac5ac1991e9 (diff) | |
download | cpython-9d872e19aac7f09d9b127936427d998bd1e3170c.zip cpython-9d872e19aac7f09d9b127936427d998bd1e3170c.tar.gz cpython-9d872e19aac7f09d9b127936427d998bd1e3170c.tar.bz2 |
fix possibily uninitialized memory usage (closes #12474)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/symtable.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 82b1ebb..a0bedfc 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -904,10 +904,10 @@ symtable_exit_block(struct symtable *st, void *ast) st->st_cur = NULL; size = PyList_GET_SIZE(st->st_stack); if (size) { - st->st_cur = (PySTEntryObject *)PyList_GET_ITEM(st->st_stack, - size - 2); if (PyList_SetSlice(st->st_stack, size - 1, size, NULL) < 0) return 0; + if (--size) + st->st_cur = (PySTEntryObject *)PyList_GET_ITEM(st->st_stack, size - 1); } return 1; } |