Hi,

i have attached a small patch for checking content length converting overflow.
polipo now responds with a 

502 Couldn't parse server headers

when objects exceed 2GB+ 

Thomas

hunk ./http_parse.c 901
                 do_log(L_WARN, ".\n");
                 len = -1;
             } else {
+               errno = 0;
                 len = strtol(buf + value_start, &endptr, 10);
hunk ./http_parse.c 903
+               if(errno == ERANGE) {
+                    do_log(L_ERROR, "Content-Length overflow: \n");
+                    do_log_n(L_ERROR, buf + value_start, [_$_]
+                             value_end - value_start);
+                    do_log(L_ERROR, ".\n");
+                    goto fail;
+                }
                 if(endptr <= buf + value_start) {
                     do_log(L_WARN, "Couldn't parse Content-Length: \n");
                     do_log_n(L_WARN, buf + value_start, [_$_]



___________________________________________________________________
WEB.DE FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und 
Telefonanschluss für 17,95 Euro/mtl.! http://produkte.web.de/go/02/


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Polipo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/polipo-users

Reply via email to