]> granicus.if.org Git - python/commitdiff
prevent symtable_params() from dereferencing off the end of the
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 23 Jan 2001 00:50:52 +0000 (00:50 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 23 Jan 2001 00:50:52 +0000 (00:50 +0000)
varagslist node. based on fix from Thomas Wouters.

Python/compile.c

index 6ca777e5bb6264a5926eeae9566d66031f6dad26..a9ff3dffdb56d6b81e1dc5637ecc87bdb5bc7d9d 100644 (file)
@@ -4325,6 +4325,8 @@ symtable_params(struct symtable *st, node *n)
                        symtable_add_def(st, STR(CHILD(n, i)), 
                                         DEF_PARAM | DEF_STAR);
                        i += 2;
+                       if (i >= NCH(n))
+                               return;
                        c = CHILD(n, i);
                }
                if (TYPE(c) == DOUBLESTAR) {