1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-04 04:16:33 +00:00

Fixed possible buffer overrun with long log lines

This commit is contained in:
Gerhard Rieger 2024-07-29 02:26:14 +02:00
parent 0cfe39a413
commit a86376cd1e
2 changed files with 7 additions and 0 deletions

View file

@ -404,6 +404,7 @@ void msg2(
if (bufp < buff+MSGLEN)
*bufp++ = ' ';
strncpy(bufp, text, MSGLEN-(bufp-buff));
bufp[MSGLEN-(bufp-buff)] = 0;
bufp = strchr(bufp, '\0');
strcpy(bufp, "\n");
_msg(level, buff, syslp);