]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
dbus_signature_validate: be sure to use a literal format string
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 7 Oct 2016 18:01:01 +0000 (19:01 +0100)
committerSimon McVittie <smcv@debian.org>
Thu, 13 Oct 2016 21:44:12 +0000 (22:44 +0100)
This was not a security vulnerability because
_dbus_validity_to_error_message() doesn't return anything containing
"%", but the compiler can't know that.

Found by adding more _DBUS_GNUC_PRINTF attributes.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
dbus/dbus-signature.c

index 6f1521b10df62b1cc4f6e8be02697524bbf3c98d..ef9eca9146a1da7b74dc036c0d99f6c6b65401e4 100644 (file)
@@ -244,7 +244,8 @@ dbus_signature_validate (const char       *signature,
     return TRUE;
   else
     {
-      dbus_set_error (error, DBUS_ERROR_INVALID_SIGNATURE, _dbus_validity_to_error_message (reason));
+      dbus_set_error (error, DBUS_ERROR_INVALID_SIGNATURE, "%s",
+          _dbus_validity_to_error_message (reason));
       return FALSE;
     }
 }