]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] message: bound per-part newline metadata master
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 22 Jul 2026 21:38:08 +0000 (22:38 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 22 Jul 2026 21:38:08 +0000 (22:38 +0100)
commit1ad069fa8363296794f49ce22e0e9f2e1d34f812
tree6fd2ea3c9d5dcadf335f670bd62a258c83a11ec6
parent285d201df9e4141ca0fda8ff155e0329fc20e419
[Fix] message: bound per-part newline metadata

Newline normalization recorded every newline as a pointer array entry
plus a mempool exception object and a GList node, then sorted the
whole exceptions list: a newline-dense body turned a few MiB of input
into hundreds of MiB of heap and millions of allocations. Cap the
recorded newline positions at 100k per part (text normalization and
line counters are unaffected), set a part flag on truncation and
expose it as newlines_truncated in textpart:get_stats().
src/libmime/message.c
src/libmime/message.h
src/lua/lua_mimepart.c
test/lua/unit/task.lua