From 28a0405d555599a624055efb03cb1b0c15aac460 Mon Sep 17 00:00:00 2001 From: TLINDEN Date: Sun, 21 Dec 2014 14:16:43 +0100 Subject: [PATCH] two more bugs of the same kind as in #5 --- src/encryption.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encryption.c b/src/encryption.c index 49b04ad..6f5f2f2 100644 --- a/src/encryption.c +++ b/src/encryption.c @@ -75,7 +75,7 @@ int pcpdecrypt(char *id, int useid, char *infile, char *outfile, char *passwd, i } symkey = pcp_scrypt(ptx, passphrase, strlen(passphrase), salt, 90); - ucfree(passphrase, strlen(passwd)+1); + ucfree(passphrase, strlen(passphrase)); free(salt); } else if(head == PCP_ASYM_CIPHER || head == PCP_ASYM_CIPHER_SIG || head == PCP_ASYM_CIPHER_ANON) { @@ -260,7 +260,7 @@ int pcpencrypt(char *id, char *infile, char *outfile, char *passwd, plist_t *rec strncpy(passphrase, passwd, strlen(passwd)+1); } secret = pcpkey_decrypt(ptx, secret, passphrase); - ucfree(passphrase, strlen(passwd)+1); + ucfree(passphrase, strlen(passphrase)); if(secret == NULL) goto erren2; }