diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-12-07 01:53:12 +0000 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-12-07 01:53:12 +0000 |
commit | ab8347aa55d5fa752284bccf02e5ca135110af71 (patch) | |
tree | c2b6edf19737919df458b2d264784fc82648e3bf | |
parent | 5deaa1d39213c0beaf160b4b9e91e8f60fff4aff (diff) | |
download | evolution-data-server-ab8347aa55d5fa752284bccf02e5ca135110af71.tar.gz |
If complete() allocates len+2 bytes for the out buffer, so should this.
2001-12-05 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-filter-basic.c (filter): If complete() allocates
len+2 bytes for the out buffer, so should this. See bug #16371 for
an example case.
-rw-r--r-- | camel/ChangeLog | 6 | ||||
-rw-r--r-- | camel/camel-mime-filter-basic.c | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 7633b4f65..8f479ca05 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2001-12-05 Jeffrey Stedfast <fejj@ximian.com> + + * camel-mime-filter-basic.c (filter): If complete() allocates + len+2 bytes for the out buffer, so should this. See bug #16371 for + an example case. + 2001-11-29 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-search.c (search_body_contains): Don't use regex diff --git a/camel/camel-mime-filter-basic.c b/camel/camel-mime-filter-basic.c index b1edd06f4..6db8f3021 100644 --- a/camel/camel-mime-filter-basic.c +++ b/camel/camel-mime-filter-basic.c @@ -93,8 +93,8 @@ static void complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace) { CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf; - int newlen; - + size_t newlen; + switch(f->type) { case CAMEL_MIME_FILTER_BASIC_BASE64_ENC: /* wont go to more than 2x size (overly conservative) */ @@ -153,8 +153,8 @@ static void filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace) { CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf; - int newlen; - + size_t newlen; + switch(f->type) { case CAMEL_MIME_FILTER_BASIC_BASE64_ENC: /* wont go to more than 2x size (overly conservative) */ @@ -181,9 +181,9 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s break; case CAMEL_MIME_FILTER_BASIC_QP_DEC: /* output can't possibly exceed the input size */ - camel_mime_filter_set_size(mf, len, FALSE); + camel_mime_filter_set_size(mf, len + 2, FALSE); newlen = quoted_decode_step(in, len, mf->outbuf, &f->state, &f->save); - g_assert(newlen <= len); + g_assert(newlen <= len + 2); break; case CAMEL_MIME_FILTER_BASIC_UU_DEC: /* output can't possibly exceed the input size */ |