summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-07 21:45:23 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-07 21:45:23 +0800
commit1b95e78d54466842ffe7be236a76c795a2e47fa7 (patch)
tree1eddf4f33870262c1eb9d7f2ee7f0a3203a4790d /mbbsd
parent989b11cc9a64f74cf2ae3a81a92610e680b4e591 (diff)
downloadpttbbs-1b95e78d54466842ffe7be236a76c795a2e47fa7.tar
pttbbs-1b95e78d54466842ffe7be236a76c795a2e47fa7.tar.gz
pttbbs-1b95e78d54466842ffe7be236a76c795a2e47fa7.tar.bz2
pttbbs-1b95e78d54466842ffe7be236a76c795a2e47fa7.tar.lz
pttbbs-1b95e78d54466842ffe7be236a76c795a2e47fa7.tar.xz
pttbbs-1b95e78d54466842ffe7be236a76c795a2e47fa7.tar.zst
pttbbs-1b95e78d54466842ffe7be236a76c795a2e47fa7.zip
* fix: crashed for read_more case in tty_read.
* example: got waterball then SEGV * reason: telnet_process should take signed size_t. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4515 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/telnet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mbbsd/telnet.c b/mbbsd/telnet.c
index f348f08c..d60254ac 100644
--- a/mbbsd/telnet.c
+++ b/mbbsd/telnet.c
@@ -55,7 +55,7 @@ tty_read(unsigned char *buf, size_t max)
if(l == 0 || (l < 0 && !(errno == EINTR || errno == EAGAIN)))
abort_bbs(0);
- if(!raw_connection)
+ if(!raw_connection || l <= 0)
return l;
l = telnet_process(ctx, buf, l);