]> granicus.if.org Git - python/commitdiff
Fix SF bug 595838 -- buffer in type_new() should not be static. Moved
authorGuido van Rossum <guido@python.org>
Fri, 16 Aug 2002 03:47:49 +0000 (03:47 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 16 Aug 2002 03:47:49 +0000 (03:47 +0000)
to inner scope, too.

Objects/typeobject.c

index 145923a2ca64b48e3cb5a6ec8f93fb5e9b40c7af..c3c5893c1f15b677dcc31351a96a0cc655c6d3a3 100644 (file)
@@ -1008,7 +1008,6 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
 {
        PyObject *name, *bases, *dict;
        static char *kwlist[] = {"name", "bases", "dict", 0};
-       static char buffer[256];
        PyObject *slots, *tmp, *newslots;
        PyTypeObject *type, *base, *tmptype, *winner;
        etype *et;
@@ -1171,6 +1170,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
                        goto bad_slots;
                for (i = j = 0; i < nslots; i++) {
                        char *s;
+                       char buffer[256];
                        tmp = PyTuple_GET_ITEM(slots, i);
                        s = PyString_AS_STRING(tmp);
                        if ((add_dict && strcmp(s, "__dict__") == 0) ||