aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--TODO.txt3
-rw-r--r--xmalloc.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 142b0f22..40e13eb5 100644
--- a/NEWS
+++ b/NEWS
@@ -85,6 +85,8 @@ fetchmail 6.3.6 (not yet released):
This is important when fetchmail is in daemon mode and /etc/resolv.conf is
changed later by dhcpcd, dhclient, pppd, openvpn or other ip-up/ipchange
scripts. Should fix Debian Bug#389270, Bug#391698.
+* Fix crash on systems that do not provide strdup() in out-of-memory conditions.
+ Patch by Andreas Krennmair.
# TRANSLATIONS:
* New en_GB (British English) translation by David Lodge.
diff --git a/TODO.txt b/TODO.txt
index 34ef153a..f390d5d0 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -10,6 +10,9 @@
Ian D. Allen, fetchmail-users. Two messages with examples.
What goes here? fetchmailrc location, server, port, user, folder, anything else?
+6.4:
+- remove dead replacement functions: strdup (Andreas Krennmair), ...
+
CODE:
- check recent list mail
- check Debian BTS and other bug trackers
diff --git a/xmalloc.c b/xmalloc.c
index c5af357c..a762d0a2 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -63,7 +63,8 @@ char *strdup(const char *s)
{
char *p;
p = (char *) malloc(strlen(s)+1);
- strcpy(p,s);
+ if (p)
+ strcpy(p,s);
return p;
}
#endif /* !HAVE_STRDUP */