Commit c183c3c4 authored by rswindell's avatar rswindell
Browse files

smb_getplaintext() MIME/multipart plain-text decode is now tolerant of

Content-Type boundary values not enclosed in quotes (e.g. like those inserted
by "Apple-Mail").
parent a3968276
......@@ -190,13 +190,15 @@ char* SMBCALL smb_getplaintext(smbmsg_t* msg, char* buf)
content_type +=16;
else
return buf;
p = strstr(content_type, "boundary=\"");
p = strstr(content_type, "boundary=");
if(p == NULL)
return buf;
SAFEPRINTF(boundary, "--%s", p + 10);
if((p = strchr(boundary,'"')) == NULL)
return buf;
*p = 0;
p += 9;
if(*p == '"')
p++;
SAFEPRINTF(boundary, "--%s", p);
if((p = strchr(boundary,'"')) != NULL)
*p = 0;
txt = buf;
while((p = strstr(txt, boundary)) != NULL) {
txt = p+strlen(boundary);
......
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