URL: https://github.com/SSSD/sssd/pull/156
Author: lslebodn
 Title: #156: FILES: Remove unnecessary check
Action: opened

PR body:
"""
"grp_iter->gr_mem" is an array of strings and not just a string.
We tried to compare first string to NULL (acctually '\0')
But after that we iterated over the array to find count of members
and we check for NULL one more time.
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/156/head:pr156
git checkout pr156
From 6b77c917c60c4fa5854ebf8a23b230f4ad52229d Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lsleb...@redhat.com>
Date: Thu, 16 Feb 2017 09:15:29 +0100
Subject: [PATCH] FILES: Remove unnecessary check

"grp_iter->gr_mem" is an array of strings and not just a string.
We tried to compare first string to NULL (acctually '\0')
But after that we iterated over the array to find count of members
and we check for NULL one more time.
---
 src/providers/files/files_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/providers/files/files_ops.c b/src/providers/files/files_ops.c
index beda47a..dc6a95d 100644
--- a/src/providers/files/files_ops.c
+++ b/src/providers/files/files_ops.c
@@ -185,7 +185,7 @@ static errno_t enum_files_groups(TALLOC_CTX *mem_ctx,
         }
         grp->gr_passwd = talloc_strdup(grp, grp_iter->gr_passwd);
 
-        if (grp_iter->gr_mem != NULL && grp_iter->gr_mem[0] != '\0') {
+        if (grp_iter->gr_mem != NULL) {
             size_t nmem;
 
             for (nmem = 0; grp_iter->gr_mem[nmem] != NULL; nmem++);
_______________________________________________
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