From 804575b5c05f1dc94ccfebf6c5736d95410a0f01 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 8 Nov 2023 19:42:41 +0200 Subject: [PATCH] Remove redundant check in dbm.open() (GH-111844) PyUnicode_FSConverter() already checks for embedded null characters. --- Modules/_dbmmodule.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index d50d2f1ef18597..ee33fe625be3d7 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;