GNOME Bugzilla – Bug 780444
nm-manager: Use g_dbus_message_new_method_error_literal() to avoid -Werror=format-security build failure
Last modified: 2017-03-23 12:15:16 UTC
GLib 2.52 added a G_GNUC_PRINTF attribute to g_dbus_message_new_method_error(). This triggered warning in NetworkManager when built with -Wformat, which is an error when built with -Werror=format-security. It seems that gcc isn't smart enough to see that (foo = "bar") should be treated as a literal. Fortunately there is a g_dbus_message_new_method_error_literal() function which does not take printf-style arguments, and we don't need them, so we can use that. This patch was originally by Rico Tzschichholz <ricotz@ubuntu.com>, and was submitted to Launchpad at https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1650972
Created attachment 348567 [details] [review] nm-manager: Use g_dbus_message_new_method_error_literal()
makes sense. merged. master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=6a77258f4ec23cfe15d944d0f106118a96c6f780 nm-1-6: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=1715ec53c1f6ceb5635d930100f2fe06fa9d130e nm-1-4: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=dec4423a9d4fd4e9b8b07a12a2f993b37c783ab8 Thanks!