1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

lib: Fix CID 1373623 Dereference after null check

We should not overload "p", this is used in the outer loop

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12276
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2016-10-12 12:35:12 +02:00 committed by Jeremy Allison
parent 9afdd95ff5
commit 6ec81ca3c1

View File

@ -524,9 +524,10 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx,
group_name = gidtoname(pass->pw_gid);
if (is_domain_name) {
p = strchr_m(group_name, *sep);
if (p != NULL) {
group_name = p + 1;
char *group_sep;
group_sep = strchr_m(group_name, *sep);
if (group_sep != NULL) {
group_name = group_sep + 1;
}
}
a_string = realloc_string_sub(a_string,