nsswitch: Fix uninitialized memory when allocating pwdlastset_prelim
authorNoel Power <noel.power@suse.com>
Wed, 16 Nov 2022 15:37:52 +0000 (15:37 +0000)
committerJule Anger <janger@samba.org>
Wed, 23 Nov 2022 13:52:37 +0000 (13:52 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15224
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 16 19:29:21 UTC 2022 on sn-devel-184

(cherry picked from commit f6284877ce07fc5ddf4f4e2d824013b645d6e12c)

Autobuild-User(v4-16-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-16-test): Wed Nov 23 13:52:37 UTC 2022 on sn-devel-184

nsswitch/pam_winbind.c

index 02a8aa8df98ecc6b34b7c70447d1c6db84c4c612..06a8db21b690afb84ec22b1fc22ee728c512ffed 100644 (file)
@@ -3228,7 +3228,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
        if (flags & PAM_PRELIM_CHECK) {
                time_t *pwdlastset_prelim = NULL;
 
-               pwdlastset_prelim = talloc_array(NULL, time_t, 1);
+               pwdlastset_prelim = talloc_zero(NULL, time_t);
                if (pwdlastset_prelim == NULL) {
                        _pam_log(ctx, LOG_CRIT,
                                 "password - out of memory");