]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
_dbus_credentials_add_from_user: Check return of add_unix_uid
authorSimon McVittie <smcv@collabora.com>
Tue, 16 Jan 2018 12:23:06 +0000 (12:23 +0000)
committerSimon McVittie <smcv@collabora.com>
Tue, 16 Jan 2018 14:21:14 +0000 (14:21 +0000)
Coverity CID 253543.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104588
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
dbus/dbus-userdb.c

index e765e794520902edebb4333dbb265857c94c806f..01bb0b54ed1d05bb18a399b1ba86888c1154c5f5 100644 (file)
@@ -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. */