php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40276 Apache crashes when page (XTemplate) writes to $_SESSION
Submitted: 2007-01-29 20:02 UTC Modified: 2007-02-06 01:00 UTC
From: zakirov at rain dot ifmo dot ru Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.2.0 OS: Windows XP Pro SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zakirov at rain dot ifmo dot ru
New email:
PHP Version: OS:

 

 [2007-01-29 20:02 UTC] zakirov at rain dot ifmo dot ru
Description:
------------
If PHP page uses XTPL library (http://xtpl.sf.net), then writing to $_SESSION causes Apache to crash.

Though commenting body of method scan_globals() (class XTemplate) neutralize bug:
...
function scan_globals () {
  reset($GLOBALS);
  foreach ($GLOBALS as $k => $v) {
    $GLOB[$k] = $v;
  }
  $this->assign('PHP', $GLOB); /* access global variables as {PHP.HTTP_SERVER_VARS.HTTP_HOST} in your template! */
}
...
function assign ($name, $val = '') {
  if (is_array($name)) {
    foreach ($name as $k => $v) {
      $this->vars[$k] = $v;
    }
  } else {
    $this->vars[$name] = $val;
  }
}
...

Reproduce code:
---------------
Download any last version of XTPL library from http://sourceforge.net/project/showfiles.php?group_id=16714

Create test template-file 'test.html':
<!-- BEGIN: main -->
<html>
<head>
</head>
<body>
</body>
</html>
<!-- END: main -->

Create and test php file:
<?php
require_once('XTemplate.php');

session_start();

$xtpl = new XTemplate('test.html');

$_SESSION['TEST'] = "test";
?>

Expected result:
----------------
Expected no errors.

Actual result:
--------------
Apache crashes. Windows shows popup:
"Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience."

Error signature:
szAppName: httpd.exe
szAppVer: 2.2.4.0
szModName: php5ts.dll
szModVer: 5.2.0.0
offset: 00098178

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-29 20:34 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-02-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Oct 07 18:05:54 2022 UTC