[tor-commits] [stegotorus/master] fixed bug in http2_server_receive.

zwol at torproject.org zwol at torproject.org
Fri Jul 20 23:17:06 UTC 2012


commit c47a57efb1859b12c83d1d59215021cbb73e2f04
Author: Vinod Yegneswaran <vinod at csl.sri.com>
Date:   Fri Nov 11 19:34:57 2011 +0000

    fixed bug in http2_server_receive.
    
    git-svn-id: svn+ssh://spartan.csl.sri.com/svn/private/DEFIANCE@139 a58ff0ac-194c-e011-a152-003048836090
---
 src/steg/x_http2.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/steg/x_http2.c b/src/steg/x_http2.c
index a1bc100..e714305 100644
--- a/src/steg/x_http2.c
+++ b/src/steg/x_http2.c
@@ -723,7 +723,6 @@ x_http2_server_receive(steg_t *s, conn_t *conn, struct evbuffer *dest, struct ev
 
   do {
     struct evbuffer_ptr s2 = evbuffer_search(source, "\r\n\r\n", sizeof ("\r\n\r\n") -1 , NULL);
-    unsigned char* limit;
     unsigned char *p;
     unsigned char c, h, secondhalf;
     char outbuf[MAX_COOKIE_SIZE];
@@ -749,12 +748,10 @@ x_http2_server_receive(steg_t *s, conn_t *conn, struct evbuffer *dest, struct ev
 
     data[s2.pos+3] = 0;
 
-    limit = data + s2.pos;
-
     type = find_uri_type((char *)data, s2.pos+4);
 
     if (strstr((char*) data, "Cookie") != NULL) {
-      p = (unsigned char*) strstr((char*) data, "Cookie:") + + sizeof "Cookie: "-1;
+      p = (unsigned char*) strstr((char*) data, "Cookie:") + sizeof "Cookie: "-1;
       cookie_mode = 1;
     }
     else
@@ -765,7 +762,7 @@ x_http2_server_receive(steg_t *s, conn_t *conn, struct evbuffer *dest, struct ev
     c = 0;
    
 
-    while (strncmp((char*) p, "\r\n", 4) != 0 && (cookie_mode != 0 || p[0] != '.')) {
+    while (strncmp((char*) p, "\r\n", 2) != 0 && (cookie_mode != 0 || p[0] != '.')) {
       if (!secondhalf) 
 	c = 0;
       if ('0' <= *p && *p <= '9') 





More information about the tor-commits mailing list