mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05: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:
1 parent
6ab920a3fc
commit
5ae549c3aa
1 file changed
+1
-3
+1
-3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user