diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-08-12 19:43:49 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-08-12 19:43:49 (GMT) |
commit | 547607c4bf97ece7ad5cc50f103cbf651560ac86 (patch) | |
tree | 8986b7d1905aacc09a69e3931fb96a9bab27da63 /Objects | |
parent | 70b041bbe737e6b0d87183a63cbcd3d72edb90e8 (diff) | |
download | cpython-547607c4bf97ece7ad5cc50f103cbf651560ac86.zip cpython-547607c4bf97ece7ad5cc50f103cbf651560ac86.tar.gz cpython-547607c4bf97ece7ad5cc50f103cbf651560ac86.tar.bz2 |
k_mul(): Moved an assert down. In a debug build, interrupting a
multiply via Ctrl+C could cause a NULL-pointer dereference due to
the assert.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/longobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 95e32ce..8c9f69a 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1722,14 +1722,14 @@ k_mul(PyLongObject *a, PyLongObject *b) bh = bl = NULL; t3 = k_mul(t1, t2); - assert(t3->ob_size >= 0); Py_DECREF(t1); Py_DECREF(t2); if (t3 == NULL) goto fail; + assert(t3->ob_size >= 0); /* Add t3. Caution: t3 can spill one bit beyond the allocated * result space; it's t3-al*bl-ah*bh that always fits. We have - * to arrange to ignore the hight bit. + * to arrange to ignore the high bit. */ if (t3->ob_size > i) { assert(t3->ob_size == i+1); /* just one digit over */ |