]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:passdb: Zero password in secrets_fetch_ipc_userpass()
authorPavel Filipenský <pfilipensky@samba.org>
Tue, 9 Aug 2022 13:36:34 +0000 (15:36 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 26 Aug 2022 07:59:32 +0000 (07:59 +0000)
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/passdb/secrets.c

index cd85807e8c1409f9722e88372eb4a3ab12dbc2aa..0ad216aaf4e5d87b591dab07bf77487d526f7e16 100644 (file)
@@ -472,14 +472,17 @@ void secrets_fetch_ipc_userpass(char **username, char **domain, char **password)
                if (!*domain || !**domain)
                        *domain = smb_xstrdup(lp_workgroup());
 
-               if (!*password || !**password)
+               if (!*password || !**password) {
+                       BURN_FREE_STR(*password);
                        *password = smb_xstrdup("");
+               }
 
                DEBUG(3, ("IPC$ connections done by user %s\\%s\n",
                          *domain, *username));
 
        } else {
                DEBUG(3, ("IPC$ connections done anonymously\n"));
+               BURN_FREE_STR(*password);
                *username = smb_xstrdup("");
                *domain = smb_xstrdup("");
                *password = smb_xstrdup("");