mirror of https://pagure.io/numad.git
numad_log: fix buffer overflow
This commit is contained in:
parent
d696d6c413
commit
3399d89305
2
numad.c
2
numad.c
|
@ -153,7 +153,7 @@ void numad_log(int level, const char *fmt, ...) {
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(p, BUF_SIZE, fmt, ap);
|
vsnprintf(p, BUF_SIZE - strlen(buf) , fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
fprintf(log_fs, "%s", buf);
|
fprintf(log_fs, "%s", buf);
|
||||||
fflush(log_fs);
|
fflush(log_fs);
|
||||||
|
|
Loading…
Reference in New Issue