Fix strncat size argument in send_handshake_query

Found by clang:
client.c:1276:26: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size]
        strncat(buf, topdomain, sizeof(buf) - strlen(buf));
                                ^~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Erik Ekman 2020-07-25 15:43:43 +02:00
parent b7b1082dc6
commit 8d2c86c73d

View file

@ -1273,7 +1273,7 @@ send_handshake_query(int fd, char *prefix)
buf[0] = 0; buf[0] = 0;
strncat(buf, prefix, 60); /* 63 - space for 3 CMC bytes */ strncat(buf, prefix, 60); /* 63 - space for 3 CMC bytes */
strcat(buf, cmc_dot); strcat(buf, cmc_dot);
strncat(buf, topdomain, sizeof(buf) - strlen(buf)); strncat(buf, topdomain, sizeof(buf) - strlen(buf) - 1);
send_query(fd, buf); send_query(fd, buf);
} }