summaryrefslogtreecommitdiff
blob: 2b6d112b2ddefcfe78060d8e612034966b2259d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Craig Leres identified a problem that makes fetchmail 6.3.2 (only this
version) crash if the .netrc file does not contain a password for a
particular account.

This patch is mostly Craig Leres' work has been committed to the
SVN repository and should be applied to fetchmail 6.3.2 on all sites
that plan to use netrc files:

Index: netrc.c
===================================================================
--- netrc.c	(Revision 4683)
+++ netrc.c	(Revision 4684)
@@ -314,8 +314,10 @@
 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);

Sorry for the inconvenience.  -- Matthias Andree, 2006-01-30