Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Modules/_csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ _set_char_or_none(const char *name, Py_UCS4 *target, PyObject *src, Py_UCS4 dflt
return -1;
}
Py_ssize_t len = PyUnicode_GetLength(src);
if (len < 0) {
return -1;
}
if (len > 1) {
PyErr_Format(PyExc_TypeError,
"\"%s\" must be a 1-character string",
Expand Down Expand Up @@ -276,6 +279,9 @@ _set_char(const char *name, Py_UCS4 *target, PyObject *src, Py_UCS4 dflt)
return -1;
}
Py_ssize_t len = PyUnicode_GetLength(src);
if (len < 0) {
return -1;
}
if (len > 1) {
PyErr_Format(PyExc_TypeError,
"\"%s\" must be a 1-character string",
Expand Down