summaryrefslogtreecommitdiff
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:32 -0500
commitbd438596e1f9808663af9c476f0a08940b19df35 (patch)
tree8e72dfa507788bcb5872982e354cdf638cda381e
parent2a4486134b96f756e01765d3e9234776051d0ff5 (diff)
downloadmongo-bd438596e1f9808663af9c476f0a08940b19df35.tar.gz
fix oplog replay segfault SERVER-4350
-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 b77993eca2b..5c1671c1ac8 100644
--- a/db/oplog.cpp
+++ b/db/oplog.cpp
@@ -741,7 +741,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 {