summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-11 05:44:18 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-11 05:44:18 (GMT)
commitb4fcf8d787783201dce026e734a7362ef96a2605 (patch)
tree10728475e7da230871b055c848a37f08e1787c51 /Modules
parent7f54740c4ddacf99eba5bb18abe904a6a4960165 (diff)
downloadcpython-b4fcf8d787783201dce026e734a7362ef96a2605.zip
cpython-b4fcf8d787783201dce026e734a7362ef96a2605.tar.gz
cpython-b4fcf8d787783201dce026e734a7362ef96a2605.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bsddb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 04e5af6..610451a 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;
}