From 97638c16c954bfb89c3cbaa9390657980fe8f27f Mon Sep 17 00:00:00 2001
From: Rob <rob@synchro.net>
Date: Thu, 8 Oct 2020 20:12:26 -0700
Subject: [PATCH] Don't pass-through ANSI Device Attributes (DA) requests

putmsg(), used to display messages and display/menu files, will no longer pass-through the ANSI sequence ESC[c (found in some corrupted ANSI posts to fsxNet->FSX_BOT echo) to the client terminal since this will stimulate a (unwanted) response from the client.

I do wonder if the outchar_esc value check should be == here instead of >=, but I'm not familiar with the string and SOS states. I wonder if any display files sent from the BBS would ever include those sequences.
---
 src/sbbs3/putmsg.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/putmsg.cpp b/src/sbbs3/putmsg.cpp
index 62fd6b3a57..6b8709908b 100644
--- a/src/sbbs3/putmsg.cpp
+++ b/src/sbbs3/putmsg.cpp
@@ -348,8 +348,8 @@ char sbbs_t::putmsgfrag(const char* buf, long* mode, long org_cols, JSObject* ob
 				if(str[l]=='A' || str[l]=='B' || str[l]=='H' || str[l]=='J'
 					|| str[l]=='f' || str[l]=='u')    /* ANSI anim */
 					lncntr=0;			/* so defeat pause */
-				if(str[l]=='"') {
-					l++;				/* don't pass on keyboard reassignment */
+				if(str[l]=='"' || str[l]=='c') {
+					l++;				/* don't pass on keyboard reassignment or Device Attributes (DA) requests */
 					continue;
 				}
 			}
-- 
GitLab