From 9b35a2bf66311a8ae1b8ff61f349920f1537f814 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 16 Jan 2018 12:23:06 +0000 Subject: [PATCH] _dbus_credentials_add_from_user: Check return of add_unix_uid Coverity CID 253543. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104588 Signed-off-by: Simon McVittie --- dbus/dbus-userdb.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-userdb.c b/dbus/dbus-userdb.c index e765e794..01bb0b54 100644 --- a/dbus/dbus-userdb.c +++ b/dbus/dbus-userdb.c @@ -540,8 +540,15 @@ _dbus_credentials_add_from_user (DBusCredentials *credentials, { _DBUS_STATIC_ASSERT (sizeof (uid) == sizeof (dbus_uid_t)); - _dbus_credentials_add_unix_uid (credentials, uid); - return TRUE; + if (_dbus_credentials_add_unix_uid (credentials, uid)) + { + return TRUE; + } + else + { + _DBUS_SET_OOM (error); + return FALSE; + } } /* If we aren't allowed to look in NSS or /etc/passwd, fail now. */ -- 2.15.1