summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-10 21:13:29 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-10 21:13:29 +0800
commit3c87bf11fca0f5e96a34dd17ac4c07b8a401a172 (patch)
treed4934bc9ec059e343b2423c7b36f426505e10f28 /common
parent9874df8a27d1e23c4e3c2b2347760e9854c06c1c (diff)
downloadpttbbs-3c87bf11fca0f5e96a34dd17ac4c07b8a401a172.tar
pttbbs-3c87bf11fca0f5e96a34dd17ac4c07b8a401a172.tar.gz
pttbbs-3c87bf11fca0f5e96a34dd17ac4c07b8a401a172.tar.bz2
pttbbs-3c87bf11fca0f5e96a34dd17ac4c07b8a401a172.tar.lz
pttbbs-3c87bf11fca0f5e96a34dd17ac4c07b8a401a172.tar.xz
pttbbs-3c87bf11fca0f5e96a34dd17ac4c07b8a401a172.tar.zst
pttbbs-3c87bf11fca0f5e96a34dd17ac4c07b8a401a172.zip
* fix: telnet protocol state error: quotes must be also considered in prescan.
* this error will occur if input buffer is small and split IAC in the middle. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4540 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'common')
-rw-r--r--common/sys/telnet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/sys/telnet.c b/common/sys/telnet.c
index ddb3de07..7c1e12c1 100644
--- a/common/sys/telnet.c
+++ b/common/sys/telnet.c
@@ -108,7 +108,9 @@ ssize_t telnet_process(TelnetCtx *ctx, unsigned char *buf, ssize_t size)
/* prescan. because IAC is rare,
* this cost is worthy. */
- if (ctx->iac_state == IAC_NONE && memchr(buf, IAC, size) == NULL)
+ if (ctx->iac_state == IAC_NONE &&
+ !ctx->iac_quote &&
+ memchr(buf, IAC, size) == NULL)
return size;
/* we have to look into the buffer. */