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: nodejs#9751
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
santigimeno committed Nov 29, 2016
1 parent 11b0872 commit 0ab2182
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 0ab2182

Please sign in to comment.