diff options
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/cursor/cur_table.c | 4 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/schema/schema_project.c | 32 |
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); |