Skip to content

Commit

Permalink
url: fix -Warray-bounds warning
Browse files Browse the repository at this point in the history
Avoid out of bounds access to `url_host_value.ipv6` array.

PR-URL: #9751
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
santigimeno authored and addaleax committed Dec 5, 2016
1 parent 6ab920a commit 5ae549c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,8 @@ namespace url {
uint16_t* piece = &host->value.ipv6[n];
if (compress_pointer == piece) {
*dest += n == 0 ? "::" : ":";
while (*piece == 0 && n < 8) {
n++;
while (*piece == 0 && ++n < 8)
piece = &host->value.ipv6[n];
}
if (n == 8)
break;
}
Expand Down

0 comments on commit 5ae549c

Please sign in to comment.