summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-11-23 02:35:13 -0500
committerEliot Horowitz <eliot@10gen.com>2011-11-23 02:35:13 -0500
commit7156346ff727362dda1890e97c071eea338ed7c5 (patch)
treea6b1bbaf1f2c32fc2620ee0e2c9c668bcff08213 /db
parent78527f722ea9da5acabea19118ad56006a80d272 (diff)
downloadmongo-7156346ff727362dda1890e97c071eea338ed7c5.tar.gz
fix oplog replay segfault SERVER-4350
Diffstat (limited to 'db')
-rw-r--r--db/dbhelpers.cpp1
-rw-r--r--db/oplog.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/db/dbhelpers.cpp b/db/dbhelpers.cpp
index cc4fdba0bde..33ac9b71298 100644
--- a/db/dbhelpers.cpp
+++ b/db/dbhelpers.cpp
@@ -157,6 +157,7 @@ namespace mongo {
}
DiskLoc Helpers::findById(NamespaceDetails *d, BSONObj idquery) {
+ assert(d);
int idxNo = d->findIdIndex();
uassert(13430, "no _id index", idxNo>=0);
IndexDetails& i = d->idx( idxNo );
diff --git a/db/oplog.cpp b/db/oplog.cpp
index e815ca52799..652fa3d1f3d 100644
--- a/db/oplog.cpp
+++ b/db/oplog.cpp
@@ -740,7 +740,7 @@ namespace mongo {
// of the form
// { _id:..., { x : {$size:...} }
// thus this is not ideal.
- else if( Helpers::findById(nsdetails(ns), updateCriteria).isNull() ) {
+ else if( nsdetails(ns) == NULL || Helpers::findById(nsdetails(ns), updateCriteria).isNull() ) {
failedUpdate = true;
}
else {