Commit b5f107aa authored by Antonin Décimo's avatar Antonin Décimo Committed by Juliusz Chroboczek

Prevent possible buffer overflow.

parent 33e28105
......@@ -406,7 +406,7 @@ main(int argc, char **argv)
memcpy(ipv6, datum_key(data[i]) + 1, 8);
memset(ipv6 + 8, 0, 8);
inet_ntop(AF_INET6, ipv6, addr, sizeof(addr));
strncat(addr, "/64", sizeof(addr) - 1);
strncat(addr, "/64", sizeof(addr) - strlen(addr) - 1);
} else {
strncpy(addr, "(corrupt)", sizeof(addr));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment