From 59c83ef10e76614f8fb743b4f05ba2d7417ba9cc Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 22 Feb 2012 20:55:27 +0100 Subject: [PATCH] httpd: ensure tcp_write() isn't called with len==0 --- apps/httpserver_raw/httpd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/httpserver_raw/httpd.c b/apps/httpserver_raw/httpd.c index e567a3f..75dd76e 100644 --- a/apps/httpserver_raw/httpd.c +++ b/apps/httpserver_raw/httpd.c @@ -610,6 +610,9 @@ http_write(struct tcp_pcb *pcb, const void* ptr, u16_t *length, u8_t apiflags) err_t err; LWIP_ASSERT("length != NULL", length != NULL); len = *length; + if (len == 0) { + return ERR_OK; + } do { LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Trying go send %d bytes\n", len)); err = tcp_write(pcb, ptr, len, apiflags);