From 7d6fae51c9f38820766d98695c2209244adfc658 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 6 May 2015 09:18:20 +0200 Subject: [PATCH 4/5] do_check_nonce: Fix of calling _dbus_string_append_len without checking return value (CID 54720). Reported by Coverity: CID: Unchecked return value (CHECKED_RETURN) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 --- dbus/dbus-nonce.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dbus/dbus-nonce.c b/dbus/dbus-nonce.c index 44c46b2..c46f15a 100644 --- a/dbus/dbus-nonce.c +++ b/dbus/dbus-nonce.c @@ -78,7 +78,13 @@ do_check_nonce (int fd, const DBusString *nonce, DBusError *error) } else { - _dbus_string_append_len(&buffer, _dbus_string_get_const_data (&p), n); + if (!_dbus_string_append_len (&buffer, _dbus_string_get_const_data (&p), n)) + { + dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); + _dbus_string_free (&p); + _dbus_string_free (&buffer); + return FALSE; + } nleft -= n; } } -- 1.8.4.5