mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-21 22:41:26 +00:00
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:
parent
b7b1082dc6
commit
8d2c86c73d
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue