]> dgit.raspbian.org Git - dovecot.git/commit
[PATCH 13/14] lib-mail: Limit total Content-Language tag count per message to 100 000
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 17 Apr 2026 13:56:37 +0000 (15:56 +0200)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
commita5df978bb0e258b0bde97f07daa77a08e106bf1a
tree90cc42aea3555faa895b070b1ef1c074578eeda6
parent0b03d253e419b2c7e6e17611ec45969cc26be0d5
[PATCH 13/14] lib-mail: Limit total Content-Language tag count per message to 100 000

A multipart message with many MIME parts each containing many language tags
can exhaust memory: the per-part RFC 2231 parser had no cumulative limit.

Add remaining_language_tags to struct message_part_data_limits, initialised
to MESSAGE_PART_DATA_MAX_TOTAL_LANGUAGE_TAGS (100 000).  Break out of the
tag-parsing loop in parse_content_language() once the budget reaches zero.

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