Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents aac81e2 + 55bff89 commit 7d8c29aCopy full SHA for 7d8c29a
1 file changed
Python/compile.c
@@ -248,8 +248,11 @@ _Py_Mangle(PyObject *privateobj, PyObject *ident)
248
}
249
plen -= ipriv;
250
251
- assert(1 <= PY_SSIZE_T_MAX - nlen);
252
- assert(1 + nlen <= PY_SSIZE_T_MAX - plen);
+ if (plen + nlen >= PY_SSIZE_T_MAX - 1) {
+ PyErr_SetString(PyExc_OverflowError,
253
+ "private identifier too large to be mangled");
254
+ return NULL;
255
+ }
256
257
maxchar = PyUnicode_MAX_CHAR_VALUE(ident);
258
if (PyUnicode_MAX_CHAR_VALUE(privateobj) > maxchar)
0 commit comments