This is a long-standing cleanup issue regarding mutt_FormatString() and the max column width "cols" parameters.
The soft-fill expando %*X has an issue where it's too easy for a series of large expandos to fill the destination buffer, causing the loop to terminate before the soft-fill expando is even reached. However, fixing this goes up against another icky issue: mutt is using mutt_FormatString() for data strings, like pgp,smime,compress invocation lines, as well as things like forward/reply-prefix lines. This wasn't an issue previously because the cols enforcment wasn't used except for right-justification or soft-fill expandos, and those data strings don't use those. The first two commits add enforcment of the cols parameter in mutt_FormatString(). The third and fourth commit fix up direct, and then indirect, data string invocations to use the destlen*2 as the "cols" size. This is just to be extra careful. Kevin J. McCarthy (4): Change mutt_FormatString() expandos to perform column truncation. Make additional mutt_FormatString() cols comparison improvements. Fix mutt_FormatString() col size for commands. Separate hdr_format string creation into window and data calls. commands.c | 3 +- compress.c | 2 +- copy.c | 2 +- curs_main.c | 2 +- edit.c | 2 +- hdrline.c | 26 +++++++++++++---- hook.c | 6 ++-- messageid.c | 2 +- muttlib.c | 80 +++++++++++++++++++++++++++++++--------------------- pager.c | 4 ++- pgpinvoke.c | 2 +- postpone.c | 4 +-- protos.h | 13 +++++---- recvattach.c | 4 +-- recvcmd.c | 12 ++++---- send.c | 10 +++---- smime.c | 2 +- 17 files changed, 106 insertions(+), 70 deletions(-) -- 2.56.1
