From 80ac250f8c9a468fbb0dd13e683a12964f6e0328 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Tue, 26 Jul 2005 16:00:42 +0000 Subject: Fix buffer underrun when buffer starts with whitespace. svn path=/trunk/; revision=4183 --- rfc822.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rfc822.c') 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; -- cgit v1.2.3