Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) -..

Decoded Output download

--TEST--
Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write after exec
--INI--
session.save_path=
session.name=PHPSESSID
session.save_handler=files
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

ob_start();

function open($save_path, $session_name) {
    return true;
}

function close() {
    echo "close: goodbye cruel world
";
    exit;
}

function read($id) {
    return '';
}

function write($id, $session_data) {
    echo "write: goodbye cruel world
";
    undefined_function();
}

function destroy($id): bool {
    return true;
}

function gc($maxlifetime) {
    return true;
}

session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
session_start();

?>
--EXPECTF--
write: goodbye cruel world

Fatal error: Uncaught Error: Call to undefined function undefined_function() in %s:%d
Stack trace:
#0 [internal function]: write(%s, '')
#1 {main}
  thrown in %s on line %d

Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0

Did this file decode correctly?

Original Code

--TEST--
Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write after exec
--INI--
session.save_path=
session.name=PHPSESSID
session.save_handler=files
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

ob_start();

function open($save_path, $session_name) {
    return true;
}

function close() {
    echo "close: goodbye cruel world\n";
    exit;
}

function read($id) {
    return '';
}

function write($id, $session_data) {
    echo "write: goodbye cruel world\n";
    undefined_function();
}

function destroy($id): bool {
    return true;
}

function gc($maxlifetime) {
    return true;
}

session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
session_start();

?>
--EXPECTF--
write: goodbye cruel world

Fatal error: Uncaught Error: Call to undefined function undefined_function() in %s:%d
Stack trace:
#0 [internal function]: write(%s, '')
#1 {main}
  thrown in %s on line %d

Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0

Function Calls

None

Variables

None

Stats

MD5 b4cea80bf0bf18ef7f7c0441a54d3bc9
Eval Count 0
Decode Time 94 ms