Commit 5f8f3398 authored by Kim Vandry's avatar Kim Vandry

Allow multipart boundaries to end with \r\n in addition to just \n

parent 5d4a2159
......@@ -881,7 +881,10 @@ static void do_multipart(struct msg_src *src,
boundary_ok = 1;
if ((b1 > input) && (*(b1-1) != '\n'))
boundary_ok = 0;
if (!looking_at_end_boundary && (b1 + boundary_len + 2 < input + input_len) && (*(b1 + boundary_len + 2) != '\n'))
if (!looking_at_end_boundary && !(
((b1 + boundary_len + 2 < input + input_len) && (*(b1 + boundary_len + 2) == '\n')) ||
((b1 + boundary_len + 3 < input + input_len) && (*(b1 + boundary_len + 2) == '\r') && (*(b1 + boundary_len + 3) == '\n'))
))
boundary_ok = 0;
if (!boundary_ok) {
char *eol = strchr(b1, '\n');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment