Skip to content

Commit 5ae549c

Browse files
santigimenoaddaleax
authored andcommitted
url: fix -Warray-bounds warning
Avoid out of bounds access to `url_host_value.ipv6` array. PR-URL: #9751 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 6ab920a commit 5ae549c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/node_url.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,8 @@ namespace url {
472472
uint16_t* piece = &host->value.ipv6[n];
473473
if (compress_pointer == piece) {
474474
*dest += n == 0 ? "::" : ":";
475-
while (*piece == 0 && n < 8) {
476-
n++;
475+
while (*piece == 0 && ++n < 8)
477476
piece = &host->value.ipv6[n];
478-
}
479477
if (n == 8)
480478
break;
481479
}

0 commit comments

Comments
 (0)