Skip to content

Commit c4324a5

Browse files
committed
CCBC-1599: account NUL-byte when format IPv6 address
Change-Id: I9f0a0f350019def8cc5f7a9734ab724135d519d2 Reviewed-on: https://review.couchbase.org/c/libcouchbase/+/192095 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Jared Casey <jared.casey@couchbase.com>
1 parent 5cde9a9 commit c4324a5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/vbucket/vbucket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ void lcbvb_replace_host(lcbvb_CONFIG *cfg, const char *hoststr)
804804
char *replacement = (char *)hoststr;
805805
if (strchr(replacement, ':')) {
806806
size_t len = strlen(hoststr);
807-
replacement = calloc(len + 2, sizeof(char));
807+
replacement = calloc(len + 3 /* '[', ']', '\0' */, sizeof(char));
808808
replacement[0] = '[';
809809
memcpy(replacement + 1, hoststr, len);
810810
replacement[len + 1] = ']';

0 commit comments

Comments
 (0)