URL: https://github.com/SSSD/sssd/pull/87
Author: jhrozek
 Title: #87: SYSDB: Only process aliases if they are non-NULL
Action: opened

PR body:
"""
This bug was found by downstream coverity check.

The aliases array is created by sysdb_get_sudo_user_info() which returns a NULL 
array if there are no aliases. We need to avoid dereferencing the array in that 
case.
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/87/head:pr87
git checkout pr87
From 520bb404dee3e40088cd5bccf5c3bcc7e1c638f1 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Thu, 24 Nov 2016 10:57:44 +0100
Subject: [PATCH] SYSDB: Only process aliases if they are non-NULL

---
 src/db/sysdb_sudo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/db/sysdb_sudo.c b/src/db/sysdb_sudo.c
index de1e8da..420c9e6 100644
--- a/src/db/sysdb_sudo.c
+++ b/src/db/sysdb_sudo.c
@@ -259,7 +259,7 @@ sysdb_get_sudo_filter(TALLOC_CTX *mem_ctx, const char *username, char **aliases,
                                                  sanitized);
         NULL_CHECK(specific_filter, ret, done);
 
-        if (case_sensitive_domain == false) {
+        if (case_sensitive_domain == false && aliases != NULL) {
             for (i = 0; aliases[i] != NULL; i++) {
                 specific_filter = talloc_asprintf_append(specific_filter, "(%s=%s)",
                                                          SYSDB_SUDO_CACHE_AT_USER,
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to