summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-08-20 15:54:57 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-08-20 15:54:57 +1000
commitf1d3532d4a11a459d0099992f2d9b0109e69747e (patch)
treebe3c5923acc02cd8f8b2f1f4931a6e9043142211
parent066fa90965bb8c0ebc8c2b068899e879abc179bb (diff)
downloadmongo-f1d3532d4a11a459d0099992f2d9b0109e69747e.tar.gz
Fix logic in WT_CURSOR_NEEDVALUE: only copy values if they are not already in the WT_ITEM's memory.
Found by valgrind reporting "Source and destination overlap in memcpy".
-rw-r--r--src/include/cursor.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/cursor.h b/src/include/cursor.h
index 6525ed9d638..74ebf12d3b8 100644
--- a/src/include/cursor.h
+++ b/src/include/cursor.h
@@ -293,7 +293,7 @@ struct __wt_cursor_table {
} while (0)
#define WT_CURSOR_NEEDVALUE(cursor) do { \
if (F_ISSET(cursor, WT_CURSTD_VALUE_INT)) { \
- if (WT_DATA_IN_ITEM(&(cursor)->value)) \
+ if (!WT_DATA_IN_ITEM(&(cursor)->value)) \
WT_ERR(__wt_buf_set( \
(WT_SESSION_IMPL *)(cursor)->session, \
&(cursor)->value, \