changeset 2465:dbff0fb46d3b

* src/socket.c: put NULL at the end of inbuff on each iteration, preventing strstr from looking at old data beyond inbuffer_len
author asl
date Sun, 09 Mar 2008 15:19:38 +0000
parents 663ef593022e
children 480aa5d146e3
files packages/net/athttpd/current/ChangeLog packages/net/athttpd/current/src/socket.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/athttpd/current/ChangeLog
+++ b/packages/net/athttpd/current/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-04  Danny Sade  <danny@channelot.com>
+
+	* src/socket.c: put NULL at the end of inbuff on each iteration,
+	preventing strstr from looking at old data beyond inbuffer_len
+
 2007-11-12  Oyvind Harboe  <oyvind.harboe@zylin.com>
 2007-11-12  Jonathan Larmour  <jifl@eCosCentric.com>
 
--- a/packages/net/athttpd/current/src/socket.c
+++ b/packages/net/athttpd/current/src/socket.c
@@ -257,6 +257,7 @@ cyg_httpd_process_request(cyg_int32 inde
         }  
     
         httpstate.inbuffer_len += len;
+        httpstate.inbuffer[httpstate.inbuffer_len] = '\0';
     }
     
     httpstate.inbuffer[httpstate.inbuffer_len] = '\0';