xref: /PHP-8.1/ext/dba/tests/bug72157.phpt (revision b5a14e6c)
1--TEST--
2Bug #72157 (use-after-free caused by dba_open)
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7    require_once(__DIR__ .'/skipif.inc');
8?>
9--FILE--
10<?php
11$var0 = fopen(__FILE__,"r");
12$var5 = dba_open(null,$var0);
13$var5 = dba_open(null,$var0);
14$var5 = dba_open(null,$var0);
15$var5 = dba_open($var0,$var0);
16?>
17--EXPECTF--
18Warning: dba_open(,Resource id #5): Illegal DBA mode in %sbug72157.php on line %d
19
20Warning: dba_open(,Resource id #5): Illegal DBA mode in %sbug72157.php on line %d
21
22Warning: dba_open(,Resource id #5): Illegal DBA mode in %sbug72157.php on line %d
23
24Warning: dba_open(Resource id #5,Resource id #5): Illegal DBA mode in %sbug72157.php on line %d
25