Cope with platforms whose vsnprintf violates both POSIX and C99 - part 1
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Sun, 3 Jul 2011 04:47:39 +0000 (06:47 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Sun, 3 Jul 2011 04:47:39 +0000 (06:47 +0200)
dbus/dbus-string.c

index b1fa598..6658abd 100644 (file)
@@ -1129,6 +1129,9 @@ _dbus_string_append_printf_valist  (DBusString        *str,
   /* Measure the message length without terminating nul */
   len = _dbus_printf_string_upper_bound (format, args);
 
+  if (len < 0)
+    return FALSE;
+
   if (!_dbus_string_lengthen (str, len))
     {
       /* don't leak the copy */