Remove redundant check in dbm.open() (GH-111844)

PyUnicode_FSConverter() already checks for embedded null characters.
This commit is contained in:
Serhiy Storchaka 2023-11-08 19:42:41 +02:00 committed by GitHub
parent a3903c8ec8
commit 804575b5c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 5 deletions

View File

@ -557,11 +557,6 @@ dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
}
const char *name = PyBytes_AS_STRING(filenamebytes);
if (strlen(name) != (size_t)PyBytes_GET_SIZE(filenamebytes)) {
Py_DECREF(filenamebytes);
PyErr_SetString(PyExc_ValueError, "embedded null character");
return NULL;
}
PyObject *self = newdbmobject(state, name, iflags, mode);
Py_DECREF(filenamebytes);
return self;