The SMTP parser should not supply lines w/o EOL chars to the mime
parser unless its in the BODY parsing stage. Mimic this in the fuzz
target by testing the state for inputs that have no EOL.
Additionally, make sure the delim cnt reflects the missing EOL.
(cherry picked from commit
816bbeb7dc3684d47d47c35a2255db0671760baa)
while (1) {
uint8_t * next = memchr(buffer, '\n', size);
if (next == NULL) {
- (void) MimeDecParseLine(buffer, size, 1, state);
+ if (state->state_flag >= BODY_STARTED)
+ (void)MimeDecParseLine(buffer, size, 0, state);
break;
} else {
(void) MimeDecParseLine(buffer, next - buffer, 1, state);