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

index 148e15c9c44e49ecf88aa35f3c5be76ff7b26aa5..c035808ac430bcbe7ba58e7000fff8822f185b24 100644 (file)
@@ -429,7 +429,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)