summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-05-23 12:35:44 +0200
committerFelix Fietkau <nbd@openwrt.org>2013-05-23 12:35:44 +0200
commit692cb27c49f9c543aef8f25f8c270a27ddec2a74 (patch)
tree97a897fa6940c776d05e5ed8792c5bbe06aad70d
parent7a6811b705d6cca54b1367459fa19bb6d1234c45 (diff)
fix infinite loop when the initial two characters in a connection are \r\n
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client.c b/client.c
index 6d23283..a971b3b 100644
--- a/client.c
+++ b/client.c
@@ -194,8 +194,10 @@ static bool client_init_cb(struct client *cl, char *buf, int len)
if (!newline)
return false;
- if (newline == buf)
+ if (newline == buf) {
+ ustream_consume(cl->us, 2);
return true;
+ }
*newline = 0;
blob_buf_init(&cl->hdr, 0);