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/ChangeLog | 5 +++++ camel/camel-mime-filter-crlf.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 4596e0e6e1..ea82773fd8 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2001-04-12 Dan Winship + + * camel-mime-filter-crlf.c (filter): Fix a pair of array bounds + reads noted by purify + 2001-04-12 Jeffrey Stedfast * camel.h: #include the pgp stuff. 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