commit | 710b5f0b2452accf3495556b8bdc614699e6f544 | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Sat Apr 06 21:23:57 2013 +0200 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Sat Apr 06 21:23:57 2013 +0200 |
tree | a6c07565bc5273d077d999c71c678c0717c3f016 | |
parent | 7d8c29a02219b06559b290e5ca0ab12d072892b0 [diff] | |
parent | 7bd190f7add07ca05d1f9402dd026b2b970118da [diff] |
Merge
diff --git a/Python/compile.c b/Python/compile.c index 0aca8bd..842ed50 100644 --- a/Python/compile.c +++ b/Python/compile.c
@@ -248,8 +248,11 @@ } plen -= ipriv; - assert(1 <= PY_SSIZE_T_MAX - nlen); - assert(1 + nlen <= PY_SSIZE_T_MAX - plen); + if (plen + nlen >= PY_SSIZE_T_MAX - 1) { + PyErr_SetString(PyExc_OverflowError, + "private identifier too large to be mangled"); + return NULL; + } maxchar = PyUnicode_MAX_CHAR_VALUE(ident); if (PyUnicode_MAX_CHAR_VALUE(privateobj) > maxchar)