commit | c759f3e7ec1ba9753d197d3708b379369586f270 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 01 03:09:58 2011 +0200 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 01 03:09:58 2011 +0200 |
tree | 8ee47ec78a43cbef051365b658a09fed226147eb | |
parent | d3a83d5eb345ef1de87419d145a83c156ebf26f8 [diff] [blame] |
Ooops, avoid a division by zero in unicode_repeat()
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index fed2cc9..92208f4 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c
@@ -10600,7 +10600,7 @@ if (PyUnicode_READY(str) == -1) return NULL; - if (len > PY_SSIZE_T_MAX / PyUnicode_GET_LENGTH(str)) { + if (PyUnicode_GET_LENGTH(str) > PY_SSIZE_T_MAX / len) { PyErr_SetString(PyExc_OverflowError, "repeated string is too long"); return NULL;