aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-filter-crlf.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-04-13 03:37:08 +0800
committerDan Winship <danw@src.gnome.org>2001-04-13 03:37:08 +0800
commit0111c4d86fb5c33a61c29868443c746c8c4cf2c5 (patch)
tree432660a084be053a2649bcafe7abef8d8114ddf0 /camel/camel-mime-filter-crlf.c
parent158d565ac0432113c2e5b59324a4ba6f85d5931c (diff)
downloadgsoc2013-evolution-0111c4d86fb5c33a61c29868443c746c8c4cf2c5.tar
gsoc2013-evolution-0111c4d86fb5c33a61c29868443c746c8c4cf2c5.tar.gz
gsoc2013-evolution-0111c4d86fb5c33a61c29868443c746c8c4cf2c5.tar.bz2
gsoc2013-evolution-0111c4d86fb5c33a61c29868443c746c8c4cf2c5.tar.lz
gsoc2013-evolution-0111c4d86fb5c33a61c29868443c746c8c4cf2c5.tar.xz
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
Diffstat (limited to 'camel/camel-mime-filter-crlf.c')
-rw-r--r--camel/camel-mime-filter-crlf.c4
1 files changed, 2 insertions, 2 deletions
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) {