From: Neal Norwitz Date: Sun, 11 Jun 2006 05:44:18 +0000 (+0000) Subject: Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL. X-Git-Tag: v2.5b1~143 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4fcf8d787783201dce026e734a7362ef96a2605;p=thirdparty%2FPython%2Fcpython.git Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL. We know it's not NULL from the ParseTuple and DbObject_Check will verify it's not NULL. --- diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index 04e5af649343..610451a8be1b 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -5560,15 +5560,13 @@ DBEnv_construct(PyObject* self, PyObject* args) static PyObject* DBSequence_construct(PyObject* self, PyObject* args, PyObject* kwargs) { - PyObject* dbobj = NULL; + PyObject* dbobj; int flags = 0; static char* kwnames[] = { "db", "flags", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:DBSequence", kwnames, &dbobj, &flags)) return NULL; - if (dbobj == Py_None) - dbobj = NULL; - else if (dbobj && !DBObject_Check(dbobj)) { + if (!DBObject_Check(dbobj)) { makeTypeError("DB", dbobj); return NULL; }