From 6ee437e845ad57a8f86dc4f3fbbaddfd487de059 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 22 Mar 2014 18:21:01 +0100 Subject: [PATCH] check for length > 0 before calling ustream_write Signed-off-by: Felix Fietkau --- uclient-http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uclient-http.c b/uclient-http.c index c3d1d5a..c344513 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -741,7 +741,8 @@ uclient_http_send_data(struct uclient *cl, char *buf, unsigned int len) uclient_http_send_headers(uh); ustream_printf(uh->us, "%X\r\n", len); - ustream_write(uh->us, buf, len, false); + if (len > 0) + ustream_write(uh->us, buf, len, false); ustream_printf(uh->us, "\r\n"); return len; -- 2.30.2