|
From: | Shashank Kavishwar |
Subject: | [bug-mailutils] qp_decode and base64_decode |
Date: | Mon, 21 Jun 2004 18:20:12 -0700 |
filter_trans.c seems to be having problems in the 2 functions qp_decode and base64_decode
1. qp_decode: message_save_attachment() does not return if a MIME message has a body of quoted-printable encoding which has a long series of spaces/HT's such that the following condition is satisfied in qp_decode(): wscount==consumed.
filter_trans.c =~ line 392
while (consumed < isize && *nbytes < osize) { }
While the above condition is satisfied, if iptr only consists of spaces/HT's, 0 will be returned indefinitely. E.g. calling message_save_attachment() with the attached file 'qp_problem.txt', does not return.
2. base64_decode: message_save_attachment() does not return if a MIME message has a mistaken body of plain 7bit text instead of base64 encoded text. The variable 'pad' keeps on increasing (quite frequent in HTML text which has the '=' quite frequently), and once pad crosses '3', *nbytes will start decreasing, ultimately resulting in a negative *nbytes value which loops indefinitely. E.g. calling message_save_attachment() with the attached file 'base64_problem.txt', does not return. |
qp_problem.txt
Description: Text document
base64_problem.txt
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |