• rswindell's avatar
    Bug: a get_mg_header() followed by a put_msg_header() would add a header field · 562f5e6d
    rswindell authored
    (SMTPREVERSEPATH a.k.a. "reverse_path") if it didn't already have one.
    That's because smb_getmsghdr() will point the msg.reverse_path convenience
    pointer to the from_net_addr if there was no explicit reverse-path (e.g. RFC822's
    "return-path" header field). This could manifest itself in *any* change to a
    message header via JS failing with an "illegal header length increase" error if
    the added header field just happen to put the total header length over the
    allocation threshold of the pre-existing msg header.
    
    Fix: only model a msg header "reverse_path" property if the header field
    actually existed (not based on the SMBLIB convenience pointer).
    When the expand_fields option is used, the old behavior remains but expanded
    headers cannot be written back to the base, so no harm there.
    
    Reported by Coz in #synchronet from failed runs of scrubmsgs.js. Thanks!
    562f5e6d
js_msgbase.c 104 KB