mirror of
https://github.com/python/cpython.git
synced 2025-07-13 06:15:17 +00:00
[3.11] gh-96670: Raise SyntaxError when parsing NULL bytes (GH-97594) (#104195)
This commit is contained in:
parent
c5dafeaa6d
commit
a09d3901a5
9 changed files with 77 additions and 22 deletions
|
@ -1859,7 +1859,7 @@ _Py_SourceAsString(PyObject *cmd, const char *funcname, const char *what, PyComp
|
|||
}
|
||||
|
||||
if (strlen(str) != (size_t)size) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
PyErr_SetString(PyExc_SyntaxError,
|
||||
"source code string cannot contain null bytes");
|
||||
Py_CLEAR(*cmd_copy);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue