This (also) fixes a flaw pointed out by the IBM checker. When verifying that I
found out that the parsing was not working as I would have expected it to.
Jerry, please check!
(cherry picked from commit
c2c7790155ab02e1e351caf2bed192ce72913663)
grp->gr_mem[i] = talloc_strdup(grp, mem_p);
BAIL_ON_PTR_ERROR(grp->gr_mem[i], wbc_status);
- *mem_q = ',';
- mem_p++;
- mem_p = mem_q;
+ if (mem_q == NULL) {
+ i += 1;
+ break;
+ }
+ mem_p = mem_q + 1;
}
- grp->gr_mem[g->num_gr_mem] = NULL;
+ grp->gr_mem[i] = NULL;
wbc_status = WBC_ERR_SUCCESS;