Commit 24b6eecc authored by Ralf Habacker's avatar Ralf Habacker

Fix crash running test-syslog on windows/wine.

Use seperate buffer in _dbus_system_logv() to avoid crash in vsprintf().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538Reviewed-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
parent 9a8a6e28
......@@ -335,7 +335,8 @@ _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args
{
char *s = "";
char buf[1024];
char format[1024];
switch(severity)
{
case DBUS_SYSTEM_LOG_INFO: s = "info"; break;
......@@ -344,8 +345,8 @@ _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args
case DBUS_SYSTEM_LOG_FATAL: s = "fatal"; break;
}
sprintf(buf,"%s%s",s,msg);
vsprintf(buf,buf,args);
snprintf(format, sizeof(format), "%s%s", s ,msg);
vsnprintf(buf, sizeof(buf), format, args);
OutputDebugStringA(buf);
if (severity == DBUS_SYSTEM_LOG_FATAL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment