b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/src/c-client/rfc822.c |
| 2 | +++ b/src/c-client/rfc822.c |
| 3 | @@ -384,6 +384,9 @@ void rfc822_parse_content (BODY *body,ST |
| 4 | if (CHR (bs) == '\012'){/* following LF? */ |
| 5 | c = SNX (bs); i--; /* yes, slurp it */ |
| 6 | } |
| 7 | + if (!i) /* Make sure we don't get an overflow for */ |
| 8 | + break; /* messages ending on \015 (or the following */ |
| 9 | + /* i-- will cause i to be MAXINT. Not good.) */ |
| 10 | case '\012': /* at start of a line, start with -- ? */ |
| 11 | if (!(i && i-- && ((c = SNX (bs)) == '-') && i-- && |
| 12 | ((c = SNX (bs)) == '-'))) break; |