diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-10 21:13:29 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-10 21:13:29 +0800 |
commit | 3c87bf11fca0f5e96a34dd17ac4c07b8a401a172 (patch) | |
tree | d4934bc9ec059e343b2423c7b36f426505e10f28 | |
parent | 9874df8a27d1e23c4e3c2b2347760e9854c06c1c (diff) | |
download | pttbbs-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
-rw-r--r-- | common/sys/telnet.c | 4 |
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. */ |