From 0525fb7ef3cb347e20db8582dcfc9c4c67bd9267 Mon Sep 17 00:00:00 2001 From: yorah Date: Mon, 17 Jun 2013 14:31:14 +0200 Subject: [PATCH] cred: deploy git__memzero to clear memory holding a password --- src/transports/cred.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transports/cred.c b/src/transports/cred.c index 4916c6e18..ba5de6e93 100644 --- a/src/transports/cred.c +++ b/src/transports/cred.c @@ -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); }