nwrap: Also check for NUL-byte in group loop
authorAndreas Schneider <asn@samba.org>
Fri, 15 Feb 2019 15:16:50 +0000 (16:16 +0100)
committerAndreas Schneider <asn@samba.org>
Thu, 28 Feb 2019 11:48:35 +0000 (12:48 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
src/nss_wrapper.c

index a81145a53305d25fec111355857b34f8faa87763..e7dd818dd853533c937bc5034aadafd5e9e0d33a 100644 (file)
@@ -2491,7 +2491,7 @@ static bool nwrap_gr_parse_line(struct nwrap_cache *nwrap, char *line)
        }
        gr->gr_mem[0] = NULL;
 
-       for(nummem=0; p; nummem++) {
+       for(nummem = 0; p != NULL && p[0] != '\0'; nummem++) {
                char **m;
                size_t m_size;
                c = p;