summaryrefslogtreecommitdiffstats
path: root/Modules/_dbmmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-11-08 17:42:41 (GMT)
committerGitHub <noreply@github.com>2023-11-08 17:42:41 (GMT)
commit804575b5c05f1dc94ccfebf6c5736d95410a0f01 (patch)
tree5adea48ff7f6256d07f85da85d2582ab85fea829 /Modules/_dbmmodule.c
parenta3903c8ec838f82338f7a7af68a6699118778e1d (diff)
downloadcpython-804575b5c05f1dc94ccfebf6c5736d95410a0f01.zip
cpython-804575b5c05f1dc94ccfebf6c5736d95410a0f01.tar.gz
cpython-804575b5c05f1dc94ccfebf6c5736d95410a0f01.tar.bz2
Remove redundant check in dbm.open() (GH-111844)
PyUnicode_FSConverter() already checks for embedded null characters.
Diffstat (limited to 'Modules/_dbmmodule.c')
-rw-r--r--Modules/_dbmmodule.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index d50d2f1..ee33fe6 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -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;