From: chris mikkelson Date: Thu, 11 Mar 2010 19:41:54 +0000 (-0600) Subject: Fix bounds-checking error in quoted-printable decoding loop. X-Git-Url: https://git.mikk.net/?a=commitdiff_plain;h=70bfec73d6dcc2627577ebff3c3f6bf4781dc456;p=liburl Fix bounds-checking error in quoted-printable decoding loop. --- diff --git a/quoted-printable.c b/quoted-printable.c index b4ef580..e078489 100644 --- a/quoted-printable.c +++ b/quoted-printable.c @@ -45,7 +45,7 @@ qp_decode(struct qp_state *qps, char *s, int len, char c; int ret = 0; - for (*olen = 0; len > 0 && size > 0; s++, len--, ret++) { + for (*olen = 0; len > 0 && *olen < size; s++, len--, ret++) { switch(qps->state) { case 0: if (*s == '=') { @@ -54,7 +54,6 @@ qp_decode(struct qp_state *qps, char *s, int len, else { *out++ = *s; (*olen)++; - size --; } break; case 1: