From c17229f066ae7fe8fa97963a0be5a5fda34bd666 Mon Sep 17 00:00:00 2001 From: Christoph Korn Date: Aug 10 2016 20:30:04 +0000 Subject: Add format string literal Prevents security issues when the string contains format specifiers. Fixes: warning: format not a string literal and no format arguments [-Wformat-security] --- diff --git a/toonz/sources/common/tsystem/tsystempd.cpp b/toonz/sources/common/tsystem/tsystempd.cpp index 169e969..4edf000 100644 --- a/toonz/sources/common/tsystem/tsystempd.cpp +++ b/toonz/sources/common/tsystem/tsystempd.cpp @@ -136,7 +136,7 @@ void TSystem::outputDebug(string s) { cerr << s << endl; #endif #else - qDebug(s.c_str()); + qDebug("%s", s.c_str()); #endif } diff --git a/toonz/sources/toonzfarm/tfarm/tlog.cpp b/toonz/sources/toonzfarm/tfarm/tlog.cpp index 4c7578e..7e14b56 100644 --- a/toonz/sources/toonzfarm/tfarm/tlog.cpp +++ b/toonz/sources/toonzfarm/tfarm/tlog.cpp @@ -91,7 +91,7 @@ void notify(LEVEL level, const QString &msg) { #else std::string str = msg.toStdString(); - syslog(Level2XPriority(level), str.c_str()); + syslog(Level2XPriority(level), "%s", str.c_str()); #endif } diff --git a/toonz/sources/toonzlib/tlog.cpp b/toonz/sources/toonzlib/tlog.cpp index 02a9a69..fcbf77a 100644 --- a/toonz/sources/toonzlib/tlog.cpp +++ b/toonz/sources/toonzlib/tlog.cpp @@ -92,7 +92,7 @@ void notify(LEVEL level, const std::string &msg) { DeregisterEventSource(handle); #else - syslog(Level2XPriority(level), msg.c_str()); + syslog(Level2XPriority(level), "%s", msg.c_str()); #endif }