]> dgit.raspbian.org Git - dovecot.git/commit
[PATCH 12/14] lib-mail: Limit total address count per message to 100 000
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 17 Apr 2026 13:55:48 +0000 (15:55 +0200)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
commit0b03d253e419b2c7e6e17611ec45969cc26be0d5
tree6aa75dc1f3d603131ae0ae3194507ac880ff9f0b
parent699d93b6856f8df0610a832810218f3363eff352
[PATCH 12/14] lib-mail: Limit total address count per message to 100 000

A message with millions of addresses across all its envelope headers can
exhaust memory when parsed (each struct message_address is ~100 bytes
regardless of whether the raw address is only a few bytes long).

Add remaining_addresses to struct message_part_data_limits, initialised to
MESSAGE_PART_DATA_MAX_TOTAL_ADDRESSES (100 000).  Pass the remaining budget
as max_addresses to message_address_parse_full() so parsing stops at the
limit, then deduct the actual count parsed from the budget.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gbp-Pq: Name 0012-lib-mail-Limit-total-address-count-per-message-to-10.patch
src/lib-mail/message-part-data.c
src/lib-mail/message-part-data.h