diff options
author | Dan Winship <danw@src.gnome.org> | 2001-04-13 03:37:08 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-04-13 03:37:08 +0800 |
commit | 0111c4d86fb5c33a61c29868443c746c8c4cf2c5 (patch) | |
tree | 432660a084be053a2649bcafe7abef8d8114ddf0 | |
parent | 158d565ac0432113c2e5b59324a4ba6f85d5931c (diff) | |
download | gsoc2013-evolution-0111c4d86fb5c33a61c29868443c746c8c4cf2c5.tar.gz gsoc2013-evolution-0111c4d86fb5c33a61c29868443c746c8c4cf2c5.tar.zst gsoc2013-evolution-0111c4d86fb5c33a61c29868443c746c8c4cf2c5.zip |
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
-rw-r--r-- | camel/ChangeLog | 5 | ||||
-rw-r--r-- | 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 <danw@ximian.com> + + * camel-mime-filter-crlf.c (filter): Fix a pair of array bounds + reads noted by purify + 2001-04-12 Jeffrey Stedfast <fejj@ximian.com> * 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) { |