diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2015-05-05 17:10:01 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2015-05-06 12:14:47 +0200 |
commit | 84b2682eef49a247d15492d8bf826232e41d3216 (patch) | |
tree | a1e01206a00903191792ffb626406e177731a767 | |
parent | 8b5788b2c2c03b890c8d462075fc215617a88bf6 (diff) | |
download | dbus-84b2682eef49a247d15492d8bf826232e41d3216.tar.gz |
auth_set_unix_credentials: Fix calling _dbus_credentials_add_pid without checking return value (CID 54708).
Reported by Coverity: CID 54708: 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-auth-script.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dbus/dbus-auth-script.c b/dbus/dbus-auth-script.c index fdbe1fe4..73872203 100644 --- a/dbus/dbus-auth-script.c +++ b/dbus/dbus-auth-script.c @@ -226,8 +226,10 @@ auth_set_unix_credentials(DBusAuth *auth, _dbus_assert_not_reached ("no memory"); } if (pid != DBUS_PID_UNSET) - _dbus_credentials_add_pid (credentials, pid); - + { + if (!_dbus_credentials_add_pid (credentials, pid)) + _dbus_assert_not_reached ("no memory"); + } _dbus_auth_set_credentials (auth, credentials); _dbus_credentials_unref (credentials); |