From a5b5fd45ee0e55acf4711fc47c0a7755a72659b8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 21 Jun 2011 14:09:52 +0100 Subject: [PATCH 2/2] In Windows _dbus_printf_string_upper_bound, don't crash on malloc failure --- dbus/dbus-sysdeps-win.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 19f6fa0..f12fcc9 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -549,6 +549,10 @@ int _dbus_printf_string_upper_bound (const char *format, bufsize *= 2; p = malloc (bufsize); + + if (p == NULL) + return -1; + len = _vsnprintf (p, bufsize - 1, format, args); free (p); } -- 1.7.5.4