decodemail from GNU Mailutils 3.17 dies with SIGSEGV on a 14-byte
message whose From local-part is an empty quoted string and whose
body is a single dot.

    From:""@t1

    .

The crash is in libmailutils/mailbox/msgenv.c. message_envelope_sender
parses the From header with mu_address_create. For ""@t1,
mu_address_sget_email returns success and sets the email pointer to
NULL (the local-part is present, the email field is not). save_return
then calls strlen on that NULL pointer.

Measured with decodemail --no-config INPUT OUTPUT. The Ubuntu package
decodemail 3.17 and a build of the 3.21 release (2025-12-11) both die:

    input From:""@t1, blank line, a line containing only "."
    3.17 and 3.21: process status -11 (SIGSEGV, signal 11)

A non-empty quoted local-part ("a"@t1), a From with no domain, the
same address in To rather than From, or a body of "body" / "x" / ".a"
does not crash. A leading mbox "From " envelope line also avoids this
path. I have not reproduced it through imap4d.

The 3.21 binary crashes on this input. The save_return call is unchanged.

save_return should treat a NULL value as an empty string, or the
caller should skip this candidate when the email pointer is NULL.

This is separate from the nested-multipart report (2026-10-29), the
dotted local-part stack overflow (parse822.c), and the header-parser
heap corruption I am sending separately.

If this report is helpful, please attribute the report to Zhaoyang Li and
Xiang Li from AOSP Lab @Nankai University.

Reply via email to