summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2015-05-06 09:18:20 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2015-05-06 12:10:59 +0200
commit2e96b07e948b0c04cd59e7fd3226695f4828f030 (patch)
tree6ae7ede0d3458ddd33dfb601463846cc59d810b3
parentcc4c2d72bcc599f8994d19b7ad409b596474ea2b (diff)
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 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--dbus/dbus-nonce.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/dbus/dbus-nonce.c b/dbus/dbus-nonce.c
index 37f30f00..0018d171 100644
--- a/dbus/dbus-nonce.c
+++ b/dbus/dbus-nonce.c
@@ -74,7 +74,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;
}
}