From 501b301ed4381fa1759c8e38e841031c451031f7 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 12 Feb 2018 22:32:49 +0100 Subject: rfc2045: blaze822_multipart: avoid buffer overflow on empty MIME part --- rfc2045.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'rfc2045.c') diff --git a/rfc2045.c b/rfc2045.c index 807a0c3..2a6376b 100644 --- a/rfc2045.c +++ b/rfc2045.c @@ -161,6 +161,8 @@ blaze822_multipart(struct message *msg, struct message **imsg) char *nextpart = mymemmem(part, msg->bodyend - part, mboundary, boundarylen); if (!nextpart) return 0; // XXX error condition + if (nextpart == part) // invalid empty MIME part + return 0; // XXX error condition if (*(nextpart-1) == '\n') nextpart--; -- cgit 1.4.1