]> granicus.if.org Git - php/commitdiff
add test for bug #69111
authorAnatol Belski <ab@php.net>
Fri, 29 Jan 2016 11:27:35 +0000 (12:27 +0100)
committerAnatol Belski <ab@php.net>
Fri, 29 Jan 2016 11:27:35 +0000 (12:27 +0100)
ext/session/tests/bug69111.phpt [new file with mode: 0644]

diff --git a/ext/session/tests/bug69111.phpt b/ext/session/tests/bug69111.phpt
new file mode 100644 (file)
index 0000000..5fc6e2c
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+Bug #69111 Crash in SessionHandler::read()
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+$sh = new SessionHandler;
+session_set_save_handler($sh);
+
+$savePath = ini_get('session.save_path');
+$sessionName = ini_get('session.name');
+
+// session_start(); // Uncommenting this makes it not crash when reading the session (see below), but it will not return any data. 
+
+$sh->open($savePath, $sessionName);
+$sh->write("foo", "bar");
+var_dump($sh->read(@$id));
+?>
+--EXPECTF--
+bool(false)