From: Serhiy Storchaka Date: Wed, 8 Nov 2023 17:42:41 +0000 (+0200) Subject: Remove redundant check in dbm.open() (GH-111844) X-Git-Tag: v3.13.0a2~152 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=804575b5c05f1dc94ccfebf6c5736d95410a0f01;p=thirdparty%2FPython%2Fcpython.git Remove redundant check in dbm.open() (GH-111844) PyUnicode_FSConverter() already checks for embedded null characters. --- diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index d50d2f1ef185..ee33fe625be3 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;