From 0111c4d86fb5c33a61c29868443c746c8c4cf2c5 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 12 Apr 2001 19:37:08 +0000 Subject: Fix a pair of array bounds reads noted by purify * camel-mime-filter-crlf.c (filter): Fix a pair of array bounds reads noted by purify svn path=/trunk/; revision=9282 --- camel/camel-mime-filter-crlf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'camel/camel-mime-filter-crlf.c') diff --git a/camel/camel-mime-filter-crlf.c b/camel/camel-mime-filter-crlf.c index 71a3e8bace..b6ae095810 100644 --- a/camel/camel-mime-filter-crlf.c +++ b/camel/camel-mime-filter-crlf.c @@ -78,7 +78,7 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace, if (*p == '\n') *q++ = '\r'; else - if (do_dots && *(p - 1) == '\n' && *p == '.') + if (do_dots && *p == '.' && (p == in || *(p - 1) == '\n')) *q++ = '.'; *q++ = *p++; } @@ -100,7 +100,7 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace, } if (do_dots) { - if (*p == '.' && *(p - 1) == '\n') { + if (*p == '.' && (p == in || *(p - 1) == '\n')) { crlf->saw_dot = TRUE; } else { if (crlf->saw_dot) { -- cgit v1.2.3