mirror of
https://passt.top/passt
synced 2025-01-22 04:05:22 +00:00
log: Match implicit va_start() with va_end() in vlogmsg()
According to C99, 7.15.1: Each invocation of the va_start and va_copy macros shall be matched by a corresponding invocation of the va_end macro in the same function and the same applies to C11. I still have to come across a platform where va_end() actually does something, but thus spake the standard. This would be reported by Coverity as "Missing varargs init or cleanup" (CWE-573). Fixes: c0426ff10bc9 ("log: Add vlogmsg()") Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
9494a51a4e
commit
50bc25a23c
2
log.c
2
log.c
@ -67,6 +67,8 @@ void vlogmsg(int pri, const char *format, va_list ap)
|
|||||||
logfile_write(pri, format, ap2);
|
logfile_write(pri, format, ap2);
|
||||||
else if (!(setlogmask(0) & LOG_MASK(LOG_DEBUG)))
|
else if (!(setlogmask(0) & LOG_MASK(LOG_DEBUG)))
|
||||||
passt_vsyslog(pri, format, ap2);
|
passt_vsyslog(pri, format, ap2);
|
||||||
|
|
||||||
|
va_end(ap2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((setlogmask(0) & LOG_MASK(LOG_DEBUG) && log_file == -1) ||
|
if ((setlogmask(0) & LOG_MASK(LOG_DEBUG) && log_file == -1) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user