From 2e1bc87b13c491f47a6fbcf9549ffa8250a2508b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Fri, 21 Dec 2018 15:02:40 +0100 Subject: winbind_nss_aix: add incomplete attr_flag initializations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Jürgen Starek, see https://bugzilla.samba.org/show_bug.cgi?id=5157 Signed-off-by: Stefan Metzmacher Reviewed-by: Bjoern Jacke --- nsswitch/winbind_nss_aix.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'nsswitch') diff --git a/nsswitch/winbind_nss_aix.c b/nsswitch/winbind_nss_aix.c index 6ccd386d3ad..343809a4b34 100644 --- a/nsswitch/winbind_nss_aix.c +++ b/nsswitch/winbind_nss_aix.c @@ -569,12 +569,12 @@ static int wb_aix_lsgroup(char *attributes[], attrval_t results[], int size) static attrval_t pwd_to_group(struct passwd *pwd) { - attrval_t r; + attrval_t r = { + .attr_flag = EINVAL, + }; struct group *grp = wb_aix_getgrgid(pwd->pw_gid); - if (!grp) { - r.attr_flag = EINVAL; - } else { + if (grp != NULL) { r.attr_flag = 0; r.attr_un.au_char = strdup(grp->gr_name); free_grp(grp); @@ -585,7 +585,9 @@ static attrval_t pwd_to_group(struct passwd *pwd) static attrval_t pwd_to_groupsids(struct passwd *pwd) { - attrval_t r; + attrval_t r = { + .attr_flag = EINVAL, + }; char *s, *p; size_t mlen; @@ -605,6 +607,7 @@ static attrval_t pwd_to_groupsids(struct passwd *pwd) replace_commas(p); free(s); + r.attr_flag = 0; r.attr_un.au_char = p; return r; @@ -663,7 +666,9 @@ static int wb_aix_user_attrib(const char *key, char *attributes[], } for (i=0;ipw_uid; -- cgit v1.2.1