mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
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];
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user