php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15106 import_request_variables segfault...
Submitted: 2002-01-18 14:32 UTC Modified: 2002-08-23 20:43 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: robert at artnickel dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.3.0-dev OS: Linux 2.4.10
Private report: No CVE-ID: None
 [2002-01-18 14:32 UTC] robert at artnickel dot com
Usage of the import_request_variables function more than once with the same value for the method type and prefix string will produce a segfault.

The example:
<html>
<body>
<?

        @import_request_variables("g", "");
        foreach($_GET as $b=>$c)
                print "Key: $b  |  Value: $c<br>\n";
        flush();
        @import_request_variables("g", "");
        foreach($_GET as $b=>$c)
                print "Key: $b  |  Value: $c<br>\n";
?>
</body>
</html>

The second foreach loop will never be reached and the flush() call will be ineffectual since the module segfaults and doesn't care about the buffer.  The segfault only affects the php module and will NOT bring down the apache server.  Although not shown here for space conservation, if by chance this is done via an include, the results are mixed.  I have some that will cause a segfault ans some that don't and I haven't figured out the difference between them.

Specifics:
  Apache 1.3.22
  Linux 2.4.10 kernel
  PHP running as a DSO with apache using the php.ini-recommended with very few modifications (available on request if necessary)

Thanks,
 --Robert

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-17 19:42 UTC] sniper@php.net
Reproduced with latest CVS HEAD. Making this 'fix before 4.3.0 is released' critical.


 [2002-08-23 20:43 UTC] zeev@php.net
Fixed for 4.2.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC