]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
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>
Fri, 8 Jul 2011 09:00:12 +0000 (11:00 +0200)
dbus/dbus-string.c

index e2eb93b9008db249340e56743bd169b3011b4355..ca3a670bb8684a4d657878853ae5cd74589b4cd3 100644 (file)
@@ -1255,6 +1255,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 */