fuzz/mime: fix call conditions and args

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.
pull/7586/head
Victor Julien 2 years ago
parent d81582c4a2
commit 816bbeb7dc

@ -43,7 +43,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
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);

Loading…
Cancel
Save