summaryrefslogtreecommitdiff
path: root/relay.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-03-15 14:38:16 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-03-15 14:38:19 +0100
commit3675d407ecf4908a231eb6bde6bb6408f20a9e81 (patch)
treeca6577c4328f0a082bbd93e7357ffeb2de08986e /relay.c
parentc9e849b50162fadb1ebaaedba7a743040c9f299f (diff)
relay: add a missing buffer availability check
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'relay.c')
-rw-r--r--relay.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/relay.c b/relay.c
index ba6b95a..83664e6 100644
--- a/relay.c
+++ b/relay.c
@@ -76,6 +76,9 @@ static void relay_process_headers(struct relay *r)
char *val;
buf = ustream_get_read_buf(s, &len);
+ if (!buf || !len)
+ break;
+
newline = strchr(buf, '\n');
if (!newline)
break;