aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2006-09-04 12:15:12 +0000
committerMatthias Andree <matthias.andree@gmx.de>2006-09-04 12:15:12 +0000
commiteef055db24af6968157b9d919613b4816c1815b7 (patch)
tree7d920a0c526868cf8a9e3b0fb3e46167a6a08827
parent22d8305ecbc03fca80f80d13894809575d297a26 (diff)
downloadfetchmail-eef055db24af6968157b9d919613b4816c1815b7.tar.gz
fetchmail-eef055db24af6968157b9d919613b4816c1815b7.tar.bz2
fetchmail-eef055db24af6968157b9d919613b4816c1815b7.zip
Avoid crash in env.c/host_fqdn if we cannot canonicalize our own hostname.
Reported by Alexander Holler. svn path=/branches/BRANCH_6-3/; revision=4908
-rw-r--r--NEWS2
-rw-r--r--env.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 118104d3..107045c3 100644
--- a/NEWS
+++ b/NEWS
@@ -108,6 +108,8 @@ fetchmail 6.3.5 (not yet released):
* ignore SIGPIPE signals and rely on functions to return EPIPE instead. This is
necessary because the former longjmp() from the signal handler is unsafe and
makes the whole fetchmail behavior undefined after the event.
+* Avoid crash in env.c/host_fqdn if we cannot canonicalize our own hostname.
+ Reported by Alexander Holler.
# CHANGES:
* Rename all fetchmail-internal lock_* functions to fm_lock_*. Obsoletes
diff --git a/env.c b/env.c
index 9b9e608c..f9a3bf9a 100644
--- a/env.c
+++ b/env.c
@@ -176,7 +176,7 @@ char *host_fqdn(int required)
}
}
- result = xstrdup(res->ai_canonname);
+ result = xstrdup(res->ai_canonname ? res->ai_canonname : tmpbuf);
fm_freeaddrinfo(res);
}
else