php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11368 "getenv("REMOTE_ADDR")" crashes PHP during session saving
Submitted: 2001-06-08 16:05 UTC Modified: 2001-06-09 08:23 UTC
From: alex at gai dot ru Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.0.5 OS: OS/2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alex at gai dot ru
New email:
PHP Version: OS:

 

 [2001-06-08 16:05 UTC] alex at gai dot ru
===cut===
<?php

 function open ($save_path, $session_name) {
    $f = fopen('log', 'a');
    fputs($f, "open ($save_path, $session_name)\n");
    fclose($f);
     return true;
 }

 function close() {
    $f = fopen('log', 'a');
    fputs($f, "close\n");
    fclose($f);
     return true;
 }

 function read ($key) {
    $f = fopen('log', 'a');
    fputs($f, "read ($key)\n");
    fclose($f);
     return "foo|i:1;";
 }

 function write ($key, $val) {
    $ip = getenv("REMOTE_ADDR");
    $f = fopen('log', 'a');
    fputs($f, "write ($key, $val)\n");
    fclose($f);
     return true;
 }

 function destroy ($key) {
    $f = fopen('log', 'a');
    fputs($f, "destroy($key)\n");
    fclose($f);
     return true;
 }

 function gc ($maxlifetime) {
     return true;
 }

 session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");

 session_start();

 $foo++;

 ?>
===cut===

this will produce only one "log" only with "open" and "read", no "write" and "close"...

this is not only 4.0.5 bug, but 4.0.4pl1 too.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-09 01:11 UTC] sniper@php.net
submitted twice

 [2001-06-09 08:23 UTC] alex at gai dot ru
This is not repetitive submission. The code is simillar, but not the same.
Bug 11367 is about directory changing and bug 11368 is about crashing, so be careful...
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Mar 24 13:01:25 2019 UTC