httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <...@joe-lewis.com>
Subject Re: http-redirect url gets corrupted in request_rec - apache 2
Date Tue, 11 Dec 2007 20:29:58 GMT
SAILESH KRISHNAMURTI, BLOOMBERG/ 731 LEXIN wrote:

> jOE- just one question, do you want me to put in the strncpy as well as snprintf. i.e
as below :                                                        sprintf (loc, strlen(location),
"%s", location);//note the comma before"%s"     strncpy(loc,location,strlen(location));  
                                      please confirm                     
>   

No, just replace those lines you sent us with what is here :

char *loc;
loc = (char*)apr_palloc(r->pool,strlen(location));
strncpy(loc,location,strlen(location));
apr_table_setn (r->headers_out, "Location", loc);
r->status = HTTP_TEMPORARY_REDIRECT;
return (HTTP_TEMPORARY_REDIRECT);


Joe
-- 
Joseph Lewis <http://sharktooth.org/>
"Divide the fire, and you will sooner put it out." - Publius Syrus

Mime
View raw message