diff options
author | Keith Bostic <keith@wiredtiger.com> | 2016-03-14 12:47:58 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2016-03-14 12:47:58 -0400 |
commit | f705399db7cd35413fe3940b3e21d6e34bdaffb3 (patch) | |
tree | 0450fff758d7763cef508b6a866fe4d6415321b5 /src/utilities | |
parent | 2764d8d2adaa75449ccb12568a2bdda85a2b2793 (diff) | |
download | mongo-f705399db7cd35413fe3940b3e21d6e34bdaffb3.tar.gz |
WT-2482: Coverity 1353015, 1353016, out-of-bounds access
Coverity thinks we can overflow a buffer -- we can't, but clarify the
code to avoid the false positive.
Diffstat (limited to 'src/utilities')
-rw-r--r-- | src/utilities/util_dump.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utilities/util_dump.c b/src/utilities/util_dump.c index 015fd9830a0..aedd9168fbd 100644 --- a/src/utilities/util_dump.c +++ b/src/utilities/util_dump.c @@ -390,7 +390,7 @@ dump_json_table_config(WT_SESSION *session, const char *uri) * file. */ if (WT_PREFIX_MATCH(uri, "table:")) { - len = strlen(uri) + strlen("colgroup:"); + len = strlen("colgroup:") + strlen(name) + 1; if ((p = malloc(len)) == NULL) return (util_err(session, errno, NULL)); (void)snprintf(p, len, "colgroup:%s", name); @@ -495,7 +495,7 @@ dump_table_config(WT_SESSION *session, WT_CURSOR *cursor, const char *uri) */ complex_table = false; if (WT_PREFIX_MATCH(uri, "table:")) { - len = strlen(uri) + strlen("colgroup:"); + len = strlen("colgroup:") + strlen(name) + 1; if ((p = malloc(len)) == NULL) return (util_err(session, errno, NULL)); (void)snprintf(p, len, "colgroup:%s", name); |