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:
parent
0cfe39a413
commit
a86376cd1e
2 changed files with 7 additions and 0 deletions
1
error.c
1
error.c
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue