summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2017-04-24 16:40:21 -0400
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-04-24 16:40:21 -0400
commite7d1e7f3ed1362f38b64ec7a9a5fcbe883b8d771 (patch)
tree3177782f25b2446f66ef9f92b9eab104bd35b5be
parent2ff2328a0a2a615884206633b287850329a73cc1 (diff)
downloadmongo-e7d1e7f3ed1362f38b64ec7a9a5fcbe883b8d771.tar.gz
WT-3300 Coverity 1374542: Dereference after null check (#3401)
False positive, but explicitly checking the stop variable should make the complaint go away.
-rw-r--r--src/session/session_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/session/session_api.c b/src/session/session_api.c
index c89e1999ef8..592d6835809 100644
--- a/src/session/session_api.c
+++ b/src/session/session_api.c
@@ -1185,8 +1185,11 @@ __wt_session_range_truncate(WT_SESSION_IMPL *session,
* data structures can move through pages faster forward than backward.
* If we don't have a start cursor, create one and position it at the
* first record.
+ *
+ * If start is NULL, stop must not be NULL, but static analyzers have
+ * a hard time with that, test explicitly.
*/
- if (start == NULL) {
+ if (start == NULL && stop != NULL) {
WT_ERR(__session_open_cursor(
(WT_SESSION *)session, stop->uri, NULL, NULL, &start));
local_start = true;