summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-01-11 16:22:07 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-11 05:52:02 +0000
commit2a282d8d3670f334b5f4f91ba3c882f92e79bfec (patch)
tree84db3fab6df0a358c2e999c03fe8c73e276418dd
parentd81680a85034fa145c8e7c649f6e4b856441cf27 (diff)
downloadmongo-2a282d8d3670f334b5f4f91ba3c882f92e79bfec.tar.gz
Import wiredtiger: 3eb27a0940672c1391d86eccf79c397fd35349ba from branch mongodb-5.2
ref: 191e1c26eb..3eb27a0940 for: 5.2.0-rc5 WT-8645 Fix v4 toolchain sanitizer errors
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_table.c4
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_project.c32
3 files changed, 24 insertions, 14 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 2c795d7072f..9cff9401cfd 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-5.2",
- "commit": "191e1c26eb8f64b372504744d0a9da621664f125"
+ "commit": "3eb27a0940672c1391d86eccf79c397fd35349ba"
}
diff --git a/src/third_party/wiredtiger/src/cursor/cur_table.c b/src/third_party/wiredtiger/src/cursor/cur_table.c
index 68776b18ba3..e95c1a5e4ae 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_table.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_table.c
@@ -731,8 +731,8 @@ __wt_table_range_truncate(WT_CURSOR_TABLE *start, WT_CURSOR_TABLE *stop)
ctable = (start != NULL) ? start : stop;
session = CUR2S(ctable);
- wt_start = &start->iface;
- wt_stop = &stop->iface;
+ wt_start = start == NULL ? NULL : &start->iface;
+ wt_stop = stop == NULL ? NULL : &stop->iface;
/* Open any indices. */
WT_RET(__curtable_open_indices(ctable));
diff --git a/src/third_party/wiredtiger/src/schema/schema_project.c b/src/third_party/wiredtiger/src/schema/schema_project.c
index 1448c840d0d..742b808f22e 100644
--- a/src/third_party/wiredtiger/src/schema/schema_project.c
+++ b/src/third_party/wiredtiger/src/schema/schema_project.c
@@ -251,8 +251,9 @@ __wt_schema_project_slice(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *
} else
WT_RET(__pack_init(session, &pack, c->key_format));
buf = &c->key;
- p = (uint8_t *)buf->data;
- end = p + buf->size;
+ end = p = (uint8_t *)buf->data;
+ if (end != NULL)
+ end += buf->size;
continue;
case WT_PROJ_VALUE:
@@ -262,8 +263,9 @@ __wt_schema_project_slice(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *
c = cp[arg];
WT_RET(__pack_init(session, &pack, c->value_format));
buf = &c->value;
- p = (uint8_t *)buf->data;
- end = p + buf->size;
+ end = p = (uint8_t *)buf->data;
+ if (end != NULL)
+ end += buf->size;
continue;
}
@@ -336,13 +338,21 @@ __wt_schema_project_slice(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *
*/
if (len > old_len)
WT_RET(__wt_buf_grow(session, buf, buf->size + len - old_len));
- p = (uint8_t *)buf->data + offset;
- /* Make room if we're inserting out-of-order. */
- if (offset + old_len < buf->size)
- memmove(p + len, p + old_len, buf->size - (offset + old_len));
- WT_RET(__pack_write(session, &pv, &p, len));
- buf->size += len - old_len;
- end = (uint8_t *)buf->data + buf->size;
+
+ /*
+ * The data reference should not be NULL, but static analyzers complain there's a
+ * path to passing a NULL to memmove.
+ */
+ end = p = (uint8_t *)buf->data;
+ if (p != NULL) {
+ p += offset;
+ /* Make room if we're inserting out-of-order. */
+ if (offset + old_len < buf->size)
+ memmove(p + len, p + old_len, buf->size - (offset + old_len));
+ WT_RET(__pack_write(session, &pv, &p, len));
+ buf->size += len - old_len;
+ end = (uint8_t *)buf->data + buf->size;
+ }
break;
default:
WT_RET_MSG(session, EINVAL, "unexpected projection plan: %c", (int)*proj);