X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/e9eb8f7b32932b8add792e68d60386f97a44e1fb..319d7107dfbed2e6248f61ad463fa6ac55ebe178:/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,