url: fix -Warray-bounds warning
Avoid out of bounds access to `url_host_value.ipv6` array. PR-URL: https://github.com/nodejs/node/pull/9751 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
11b087222b
commit
0ab2182199
@ -472,10 +472,8 @@ namespace url {
|
|||||||
uint16_t* piece = &host->value.ipv6[n];
|
uint16_t* piece = &host->value.ipv6[n];
|
||||||
if (compress_pointer == piece) {
|
if (compress_pointer == piece) {
|
||||||
*dest += n == 0 ? "::" : ":";
|
*dest += n == 0 ? "::" : ":";
|
||||||
while (*piece == 0 && n < 8) {
|
while (*piece == 0 && ++n < 8)
|
||||||
n++;
|
|
||||||
piece = &host->value.ipv6[n];
|
piece = &host->value.ipv6[n];
|
||||||
}
|
|
||||||
if (n == 8)
|
if (n == 8)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user