Skip to content
  • René Scharfe's avatar
    imap-send: increase command size limit · 21b5821a
    René Scharfe authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    nfvasprintf() has a 8KB limit, but it's not relevant, as its result is
    combined with other strings and added to a 1KB buffer by its caller.
    That 1KB limit is not mentioned in RFC 9051, which specifies IMAP.
    
    While 1KB is plenty for user names, passwords and mailbox names,
    there's no point in limiting our commands like that.  Call xstrvfmt()
    instead of open-coding it and use strbuf to format the command to
    send, as we need its length.  Fail hard if it exceeds INT_MAX, because
    socket_write() can't take more than that.
    
    Suggested-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarRené Scharfe <l.s.r@web.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    21b5821a