[Olsr-dev] [PATCH v1 01/18] info: ensure the request is initially empty

Ferry Huberts (spam-protected)
Sat Dec 10 18:25:11 CET 2016


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/info/olsrd_info.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/info/olsrd_info.c b/lib/info/olsrd_info.c
index 0d5589e..881541a 100644
--- a/lib/info/olsrd_info.c
+++ b/lib/info/olsrd_info.c
@@ -692,6 +692,8 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int
   unsigned int send_what = 0;
   unsigned int http_status = INFO_HTTP_OK;
 
+  *req = '\0';
+
   if ((ipc_connection = accept(fd, &sock_addr.in, &sock_addr_len)) < 0) {
 #ifndef NODEBUG
     olsr_printf(1, "(%s) accept()=%s\n", name, strerror(errno));
@@ -769,7 +771,6 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int
     return;
   }
 
-  *req = '\0';
   rx_count = recv(ipc_connection, req, sizeof(req_buffer), 0); /* Win32 needs the cast here */
 
   /* Upon successful completion, recv() shall return the length of the message
-- 
2.9.3




More information about the Olsr-dev mailing list