From: Benjamin Peterson Date: Sat, 2 Jul 2011 14:22:13 +0000 (-0500) Subject: fix possibily uninitialized memory usage (closes #12474) X-Git-Tag: v3.3.0a1~1982 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d872e19aac7f09d9b127936427d998bd1e3170c;p=thirdparty%2FPython%2Fcpython.git fix possibily uninitialized memory usage (closes #12474) --- diff --git a/Python/symtable.c b/Python/symtable.c index 82b1ebb7fa86..a0bedfc767e3 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; }