aboutsummaryrefslogtreecommitdiffstats
path: root/netrc.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2006-01-30 09:00:03 +0000
committerMatthias Andree <matthias.andree@gmx.de>2006-01-30 09:00:03 +0000
commitf6a2380b73de5b9c5fe306f362c8f5597749c552 (patch)
treea108fc3f71caf57b9977351e4ea70de68f9fe6ef /netrc.c
parent5fd53e954ceb7aba4e42a9869f7338197256ec30 (diff)
downloadfetchmail-f6a2380b73de5b9c5fe306f362c8f5597749c552.tar.gz
fetchmail-f6a2380b73de5b9c5fe306f362c8f5597749c552.tar.bz2
fetchmail-f6a2380b73de5b9c5fe306f362c8f5597749c552.zip
Craig Leres: only overwrite password if the pointer is non-NULL. Avoids a crash in .netrc files with missing passwords.
svn path=/branches/BRANCH_6-3/; revision=4684
Diffstat (limited to 'netrc.c')
-rw-r--r--netrc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/netrc.c b/netrc.c
index 6c68d2c0..ea422edf 100644
--- a/netrc.c
+++ b/netrc.c
@@ -314,8 +314,10 @@ void
free_netrc(netrc_entry *a) {
while(a) {
netrc_entry *n = a->next;
- memset(a->password, 0x55, strlen(a->password));
- xfree(a->password);
+ if (a->password != NULL) {
+ memset(a->password, 0x55, strlen(a->password));
+ free(a->password);
+ }
xfree(a->login);
xfree(a->host);
xfree(a);