From 9c09a82a72f1ae273b25a8cb712ba601e248934a Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 26 Feb 2012 06:09:17 +0000 Subject: Add def to prevent malicious hidden text. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5572 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/pfterm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pttbbs/mbbsd/pfterm.c b/pttbbs/mbbsd/pfterm.c index 849ba49a..f4d95c05 100644 --- a/pttbbs/mbbsd/pfterm.c +++ b/pttbbs/mbbsd/pfterm.c @@ -1310,14 +1310,19 @@ outc(unsigned char c) else // normal characters { assert (ft.x >= 0 && ft.x < ft.cols); - - // normal characters - FTC = c; +#ifdef PFTERM_DISABLE_HIDDEN_MESSAGE + if (FTATTR_GETFG(ft.attr) == FTATTR_GETBG(ft.attr) && + (ft.attr & ~(FTATTR_FGMASK | FTATTR_BGMASK)) == 0) + c = ' '; +#endif #ifdef FTATTR_TRANSPARENT if (ft.attr != FTATTR_TRANSPARENT) #endif // FTATTR_TRANSPARENT FTA = ft.attr; + // normal characters + FTC = c; + ft.x++; // XXX allow x == ft.cols? if (ft.x >= ft.cols) -- cgit v1.2.3