]> git.proxmox.com Git - libgit2.git/commitdiff
cred: deploy git__memzero to clear memory holding a password
authoryorah <yoram.harmelin@gmail.com>
Mon, 17 Jun 2013 12:31:14 +0000 (14:31 +0200)
committeryorah <yoram.harmelin@gmail.com>
Mon, 17 Jun 2013 13:42:34 +0000 (15:42 +0200)
src/transports/cred.c

index 4916c6e18ad2d30a835c7e15eecd94a9ed15fa15..ba5de6e93f5c2fa81c7625c4a89b030c8ebf0ca1 100644 (file)
@@ -17,7 +17,7 @@ static void plaintext_free(struct git_cred *cred)
        git__free(c->username);
 
        /* Zero the memory which previously held the password */
-       memset(c->password, 0x0, pass_len);
+       git__memzero(c->password, pass_len);
        git__free(c->password);
 
        memset(c, 0, sizeof(*c));
@@ -73,7 +73,7 @@ static void ssh_keyfile_passphrase_free(struct git_cred *cred)
 
     if (c->passphrase) {
         /* Zero the memory which previously held the passphrase */
-        memset(c->passphrase, 0x0, pass_len);
+        git__memzero(c->passphrase, pass_len);
         git__free(c->passphrase);
     }