From d247a257b1659ae4b1623e162b1fb6346b172517 Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Mon, 24 Oct 2022 15:46:59 -0700 Subject: [PATCH] Strip control chars/ctrl-A sequences from msg subject in notify() We may want Ctrl-A sequences in the telegram subject, but not in the message subject --- src/sbbs3/postmsg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sbbs3/postmsg.cpp b/src/sbbs3/postmsg.cpp index b4cecbd343..ff4f5f5200 100644 --- a/src/sbbs3/postmsg.cpp +++ b/src/sbbs3/postmsg.cpp @@ -675,7 +675,9 @@ extern "C" int notify(scfg_t* cfg, uint usernumber, const char* subject, const c SAFEPRINTF(str, "%u", usernumber); smb_hfield_str(&msg, RECIPIENTEXT, str); } - smb_hfield_str(&msg, SUBJECT, subject); + char* msgsubj = strip_ctrl(subject, NULL); + smb_hfield_str(&msg, SUBJECT, msgsubj); + free(msgsubj); add_msg_ids(cfg, &smb, &msg, /* remsg: */NULL); if(msgbase_open(cfg, &smb, INVALID_SUB, &storage, &dupechk_hashes, &xlat) == SMB_SUCCESS) { smb_addmsg(&smb, &msg, storage, dupechk_hashes, xlat, (uchar*)text, /* tail: */NULL); -- GitLab