mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-18 18:23:25 +03:00
fix coverity issue 1372473 Out-of-bounds write
This commit is contained in:
parent
703427a486
commit
2467a0a990
@ -696,8 +696,8 @@ static bool urldb__host_is_ip_address(const char *host)
|
||||
}
|
||||
|
||||
ipv6_addr_len = host_len - 2;
|
||||
if (ipv6_addr_len > sizeof(ipv6_addr)) {
|
||||
ipv6_addr_len = sizeof(ipv6_addr);
|
||||
if (ipv6_addr_len >= sizeof(ipv6_addr)) {
|
||||
ipv6_addr_len = sizeof(ipv6_addr) - 1;
|
||||
}
|
||||
strncpy(ipv6_addr, sane_host + 1, ipv6_addr_len);
|
||||
ipv6_addr[ipv6_addr_len] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user