aboutsummaryrefslogtreecommitdiffstats
path: root/rfc822.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2005-07-26 16:00:42 +0000
committerMatthias Andree <matthias.andree@gmx.de>2005-07-26 16:00:42 +0000
commit80ac250f8c9a468fbb0dd13e683a12964f6e0328 (patch)
tree604d78409e25fe41e6f47073e4d7f65926799c9d /rfc822.c
parent1fab1b96e1481c343dbf80dc9afbb61c8fef7ac3 (diff)
downloadfetchmail-80ac250f8c9a468fbb0dd13e683a12964f6e0328.tar.gz
fetchmail-80ac250f8c9a468fbb0dd13e683a12964f6e0328.tar.bz2
fetchmail-80ac250f8c9a468fbb0dd13e683a12964f6e0328.zip
Fix buffer underrun when buffer starts with whitespace.
svn path=/trunk/; revision=4183
Diffstat (limited to 'rfc822.c')
-rw-r--r--rfc822.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rfc822.c b/rfc822.c
index 5e335616..99c78c0e 100644
--- a/rfc822.c
+++ b/rfc822.c
@@ -264,7 +264,8 @@ unsigned char *nxtaddr(const unsigned char *hdr /* header to be parsed, NUL to c
state = ENDIT_ALL;
if (tp)
{
- while (isspace(address[--tp]))
+ --tp;
+ while (tp >= 0 && isspace(address[tp--]))
continue;
address[++tp] = '\0';
tp = 0;