httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "SAILESH KRISHNAMURTI, BLOOMBERG/ 731 LEXIN" <skrishnam...@bloomberg.net>
Subject Re: http-redirect url gets corrupted in request_rec - apache 2
Date Wed, 12 Dec 2007 19:16:53 GMT


----- Original Message -----
From: Joe Lewis <modules-dev@httpd.apache.org>
To: modules-dev@httpd.apache.org
At: 12/11 15:30:39

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);

Hi Joe, I tried it with the strncpy and the snprintf, before i recieved this reply from you.
From what I can see it seems to be working. will keep you posted if i run into any more issues.
thanks a lot or the help.
Joe
-- 
Joseph Lewis <http://sharktooth.org/>
"Divide the fire, and you will sooner put it out." - Publius Syrus

Mime
View raw message