version 1.2, 2012/03/10 00:26:49
|
version 1.3.4.1, 2012/07/31 11:56:16
|
Line 45 SUCH DAMAGE.
|
Line 45 SUCH DAMAGE.
|
*/ |
*/ |
#include "global.h" |
#include "global.h" |
#include "mime.h" |
#include "mime.h" |
#include "tools.h" |
|
|
|
|
|
static int decode_quoted(char *, int, char *); |
static int decode_quoted(char *, int, char *); |
Line 170 hdrValue(const char *str, size_t len, const char **end
|
Line 169 hdrValue(const char *str, size_t len, const char **end
|
e = str + len; |
e = str + len; |
while (str < e) { |
while (str < e) { |
if (!(crlf = findtextpos(str, e - str, CRLF, strlen(CRLF)))) { |
if (!(crlf = findtextpos(str, e - str, CRLF, strlen(CRLF)))) { |
www_SetErr(EBADMSG, "Bad header format of MIME part"); | www_SetErr(EFAULT, "Bad header format of MIME part"); |
return NULL; |
return NULL; |
} |
} |
|
|
Line 362 mime_parseMultiPart(const char *str, size_t len, const
|
Line 361 mime_parseMultiPart(const char *str, size_t len, const
|
|
|
/* check boundary tag */ |
/* check boundary tag */ |
if (memcmp(str, strstr(bd[0].iov_base, "--"), strlen(strstr(bd[0].iov_base, "--")))) { |
if (memcmp(str, strstr(bd[0].iov_base, "--"), strlen(strstr(bd[0].iov_base, "--")))) { |
www_SetErr(EBADMSG, "Bad content data, not found boundary tag"); | www_SetErr(EFAULT, "Bad content data, not found boundary tag"); |
free(bd[1].iov_base); |
free(bd[1].iov_base); |
free(bd[0].iov_base); |
free(bd[0].iov_base); |
free(mime); |
free(mime); |
Line 496 mime_parseHeader(struct tagMIME * __restrict m, const
|
Line 495 mime_parseHeader(struct tagMIME * __restrict m, const
|
colon = memchr(str, ':', e - str); |
colon = memchr(str, ':', e - str); |
eoh = findtextpos(str, e - str, CRLF, strlen(CRLF)); |
eoh = findtextpos(str, e - str, CRLF, strlen(CRLF)); |
if (!colon || !eoh || colon > eoh) { |
if (!colon || !eoh || colon > eoh) { |
www_SetErr(EBADMSG, "Bad MIME format message"); | www_SetErr(EFAULT, "Bad MIME format message"); |
freeHeader(m); |
freeHeader(m); |
return -1; |
return -1; |
} |
} |