]> granicus.if.org Git - python/commitdiff
Darn! Don't divide by zero. Bad fix. :-)
authorGuido van Rossum <guido@python.org>
Fri, 11 Oct 2002 23:39:35 +0000 (23:39 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 11 Oct 2002 23:39:35 +0000 (23:39 +0000)
Objects/listobject.c

index 2cb08d316658965147da4e2fed5f8e6190100810..45b0951da3ebadc2e38bd95a92dd51749831ef34 100644 (file)
@@ -421,7 +421,7 @@ list_repeat(PyListObject *a, int n)
        if (n < 0)
                n = 0;
        size = a->ob_size * n;
-       if (size/a->ob_size != n)
+       if (n && size/n != a->ob_size)
                return PyErr_NoMemory();
        np = (PyListObject *) PyList_New(size);
        if (np == NULL)