diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-08-20 15:54:57 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-08-20 15:54:57 +1000 |
commit | f1d3532d4a11a459d0099992f2d9b0109e69747e (patch) | |
tree | be3c5923acc02cd8f8b2f1f4931a6e9043142211 | |
parent | 066fa90965bb8c0ebc8c2b068899e879abc179bb (diff) | |
download | mongo-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.h | 2 |
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, \ |