summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2001-12-05 18:12:21 +0000
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-05-04 18:13:31 -0700
commit093842a5e11bb5c0fd17b51a6c037634b5a3a223 (patch)
tree3e274c5439a6843a62d76b557d497f472a81f88d /server.c
parent30392c1e635663e5b3eb5771d8ce4c852cada4b8 (diff)
downloadxscope-093842a5e11bb5c0fd17b51a6c037634b5a3a223.tar.gz
Avoid infinite loop on broken protocol
Diffstat (limited to 'server.c')
-rw-r--r--server.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/server.c b/server.c
index a67090d..383a66b 100644
--- a/server.c
+++ b/server.c
@@ -500,6 +500,8 @@ long StartRequest (fd, buf, n)
/* bytes 0,1 are ignored now; bytes 2,3 tell us the request length */
requestlength = IShort(&buf[2]);
+ if (requestlength == 0)
+ requestlength=0xffff;
CS[fd].ByteProcessing = FinishRequest;
CS[fd].NumberofBytesNeeded = 4 * requestlength;
debug(8,(stderr, "need %d more bytes to finish request\n",