Fix syslog buffer overflow (Bug#270, reported by Kevin Jordan)
This commit is contained in:
parent
cb50e7e135
commit
0c1ae1965e
1 changed files with 1 additions and 1 deletions
|
@ -139,7 +139,7 @@ void syslog(int lprty, const char *msg,...)
|
|||
len += sprintf(buff + len, "[%d]: ", LogPid);
|
||||
}
|
||||
va_start(ap, msg);
|
||||
len += vsprintf(buff + len, msg, ap);
|
||||
len += vsnprintf(buff + len, sizeof(buff) - len, msg, ap);
|
||||
va_end(ap);
|
||||
rc = write(nfd, buff, len);
|
||||
if ((rc != len && LogFlags & LOG_CONS) || LogFlags & LOG_PERROR) {
|
||||
|
|
Loading…
Reference in a new issue