X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/159f3470a01211557dcd39f5701dcaf0f43f6683..b0b15b7ced28b3c6ddfcd4b0a7e46ee6432a243c:/lib/mime.c diff --git a/lib/mime.c b/lib/mime.c index da41426..b7975f2 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -21,14 +21,10 @@ * @brief Support for MIME and allied protocols */ -#include -#include "types.h" +#include "common.h" -#include #include -#include - #include "mem.h" #include "mime.h" #include "vector.h" @@ -381,15 +377,19 @@ int mime_multipart(const char *s, int ret; /* We must start with a boundary string */ - if(!isboundary(s, boundary, bl)) + if(!isboundary(s, boundary, bl)) { + error(0, "mime_multipart: first line is not the boundary string"); return -1; + } /* Keep going until we hit a final boundary */ while(!isfinal(s, boundary, bl)) { s = strstr(s, "\r\n") + 2; start = s; while(!isboundary(s, boundary, bl)) { - if(!(e = strstr(s, "\r\n"))) + if(!(e = strstr(s, "\r\n"))) { + error(0, "mime_multipart: line does not end CRLF"); return -1; + } s = e + 2; } if((ret = callback(xstrndup(start,