summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/csuite
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-01-14 15:04:28 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-14 04:29:57 +0000
commita37b54f07ca4cc3a057e3e472d8546e6446e58fe (patch)
treeee94b27c4835ff580caafe1d1c503f86c8a6d158 /src/third_party/wiredtiger/test/csuite
parent2007de02e0145947cd008c52d75d5b2d120339bc (diff)
downloadmongo-a37b54f07ca4cc3a057e3e472d8546e6446e58fe.tar.gz
Import wiredtiger: 8a5752fd9c0904de30181404c644410b901a6e51 from branch mongodb-master
ref: 3fd772a321..8a5752fd9c for: 5.3.0 WT-8486 Don't call memcmp with NULL pointers even if the comparison length is 0
Diffstat (limited to 'src/third_party/wiredtiger/test/csuite')
-rw-r--r--src/third_party/wiredtiger/test/csuite/wt3338_partial_update/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/test/csuite/wt3338_partial_update/main.c b/src/third_party/wiredtiger/test/csuite/wt3338_partial_update/main.c
index 2f29065be5f..e3ae228c204 100644
--- a/src/third_party/wiredtiger/test/csuite/wt3338_partial_update/main.c
+++ b/src/third_party/wiredtiger/test/csuite/wt3338_partial_update/main.c
@@ -121,7 +121,8 @@ compare(WT_ITEM *orig, WT_ITEM *local, WT_ITEM *library)
const uint8_t *p, *t;
max = WT_MIN(local->size, library->size);
- if (local->size != library->size || memcmp(local->data, library->data, local->size) != 0) {
+ if (local->size != library->size ||
+ (local->size != 0 && memcmp(local->data, library->data, local->size) != 0)) {
for (i = 0, p = local->data, t = library->data; i < max; ++i, ++p, ++t)
if (*p != *t)
break;
@@ -133,9 +134,8 @@ compare(WT_ITEM *orig, WT_ITEM *local, WT_ITEM *library)
show(orig, "original");
show(local, "local results");
show(library, "library results");
+ testutil_assert(false);
}
- testutil_assert(
- local->size == library->size && memcmp(local->data, library->data, local->size) == 0);
}
/*