summaryrefslogtreecommitdiffstats
path: root/mbbsd/pfterm.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-05 22:24:15 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-05 22:24:15 +0800
commit312ac55f526f388f6154c9861f232659d348aae2 (patch)
treecc79a20059db4b61567b2232853efaba11eb9b85 /mbbsd/pfterm.c
parent0e2068d6d86ca7a398a99737736aa4456f9f531c (diff)
downloadpttbbs-312ac55f526f388f6154c9861f232659d348aae2.tar
pttbbs-312ac55f526f388f6154c9861f232659d348aae2.tar.gz
pttbbs-312ac55f526f388f6154c9861f232659d348aae2.tar.bz2
pttbbs-312ac55f526f388f6154c9861f232659d348aae2.tar.lz
pttbbs-312ac55f526f388f6154c9861f232659d348aae2.tar.xz
pttbbs-312ac55f526f388f6154c9861f232659d348aae2.tar.zst
pttbbs-312ac55f526f388f6154c9861f232659d348aae2.zip
- fix potential exploits (reported by kcwu)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3795 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/pfterm.c')
-rw-r--r--mbbsd/pfterm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mbbsd/pfterm.c b/mbbsd/pfterm.c
index 9c988ea2..11a4d66c 100644
--- a/mbbsd/pfterm.c
+++ b/mbbsd/pfterm.c
@@ -1068,6 +1068,10 @@ outstr(const char *str)
void
outc(unsigned char c)
{
+ // 0xFF is invalid for most cases (even DBCS),
+ if (c == 0xFF || c == 0x00)
+ return;
+
fterm_markdirty();
if (ft.szcmd)
{
@@ -1392,6 +1396,8 @@ fterm_exec(void)
case 'G': // CHA: CSI n G
// Moves the cursor to column n.
+ if (n < 1)
+ n = 1;
getyx(&y, &x);
move(y, n-1);
break;