Re: segfault when running strpos (was header)!
| From: | Chris Malton | Date: | Wed, 07 Feb 2007 20:16:48 +0000 |
| Subject: | Re: segfault when running strpos (was header)! | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27895@lists.php.net to get a copy of this message | ||
Antony Dovgal wrote:
> On 02/07/2007 10:41 PM, Chris wrote:
>>>> Need any more info? Give me a buzz.
>>>
>>> A reproduce case?
>>>
>>
>> WHOOPS - Turns out it isn't header that breaks it!
>>
>> The following code breaks php6 at the cmd line.
>>
>> <?php
>> if($_GET["ffcheck"]==""){
>> $ua=$_SERVER['HTTP_USER_AGENT'];
>> if(strpos($ua,"MSIE")!==false){ *segfaults HERE*
>> //USER AGENT = MSIE!
>> header("Location:
>> http://shared.cjsoftuk.dyndns.org/Firefox.php?URL="
>> . urlencode("http://" .
>> $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]
>> . "?" . $_SERVER["QUERY_STRING"]));
>> exit();
>> }
>> }
>> ?>
>
> Could you please provide a short but complete reproduce case, so I can
> just copy/paste it and reproduce the problem.
> With this code I can see only "Notice: Undefined index: ffcheck in ..",
> but no segfault.
>
> Thank you.
>
Please see below for a term session:
root@SERVER:~/php6# cat /srv/www/include/firefox.inc
<?php
//if($_GET["ffcheck"]==""){
//$ua=$_SERVER['HTTP_USER_AGENT'];
if(strpos($ua,"MSIE")!==false){
//USER AGENT = MSIE!
header("Location: http://shared.cjsoftuk.dyndns.org/Firefox.php?URL="
. urlencode("http://" . $_SERVER["HTTP_HOST"] .
$_SERVER["REQUEST_URI"]
. "?" . $_SERVER["QUERY_STRING"]));
exit();
}
//}
?>
root@SERVER:~/php6# php6 /srv/www/include/firefox.inc
Segmentation fault
(I know I shouldn't be root, but anyway it's over LAN).
See my point?
Chris