File tree 3 files changed +53
-3
lines changed
3 files changed +53
-3
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ PHP NEWS
20
20
- Curl:
21
21
. Fix various memory leaks in curl mime handling. (nielsdos)
22
22
23
+ - DBA:
24
+ . Fixed bug GH-16990 (dba_list() is now zero-indexed instead of using
25
+ resource ids) (kocsismate)
26
+
23
27
- DOM:
24
28
. Fixed bug GH-16906 (Reloading document can cause UAF in iterator).
25
29
(nielsdos)
Original file line number Diff line number Diff line change @@ -1293,9 +1293,9 @@ PHP_FUNCTION(dba_list)
1293
1293
1294
1294
zval * zv ;
1295
1295
ZEND_HASH_MAP_FOREACH_VAL (& DBA_G (connections ), zv ) {
1296
- dba_info * info = Z_DBA_INFO_P (zv );
1297
- if (info ) {
1298
- add_next_index_str (return_value , zend_string_copy (info -> path ));
1296
+ dba_connection * connection = Z_DBA_CONNECTION_P (zv );
1297
+ if (connection -> info ) {
1298
+ add_index_str (return_value , connection -> std . handle , zend_string_copy (connection -> info -> path ));
1299
1299
}
1300
1300
} ZEND_HASH_FOREACH_END ();
1301
1301
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-16990 (dba_list() is now zero-indexed instead of using resource ids)
3
+ --EXTENSIONS--
4
+ dba
5
+ --CONFLICTS--
6
+ dba
7
+ --SKIPIF--
8
+ <?php
9
+ require_once __DIR__ . '/setup/setup_dba_tests.inc ' ;
10
+ check_skip ('flatfile ' );
11
+ ?>
12
+ --FILE--
13
+ <?php
14
+
15
+ require_once (__DIR__ .'/test.inc ' );
16
+
17
+ $ foo1 = new stdClass ();
18
+
19
+ $ db_filename1 = __DIR__ .'/test1.dbm ' ;
20
+ $ db1 = dba_open ($ db_filename1 , 'c ' , 'flatfile ' );
21
+ if (!$ db1 ) {
22
+ var_dump ("Database file creation failed " );
23
+ }
24
+
25
+ $ foo2 = new stdClass ();
26
+
27
+ $ db_filename2 = __DIR__ .'/test2.dbm ' ;
28
+ $ db2 = dba_open ($ db_filename2 , 'c ' , 'flatfile ' );
29
+ if (!$ db2 ) {
30
+ var_dump ("Database file creation failed " );
31
+ }
32
+
33
+ var_dump (dba_list ());
34
+ ?>
35
+ --CLEAN--
36
+ <?php
37
+ @unlink (__DIR__ .'/test1.dbm ' );
38
+ @unlink (__DIR__ .'/test2.dbm ' );
39
+ ?>
40
+ --EXPECTF--
41
+ array(2) {
42
+ [2]=>
43
+ string(%d) "%s%etest1.dbm"
44
+ [4]=>
45
+ string(%d) "%s%etest2.dbm"
46
+ }
You can’t perform that action at this time.
0 commit comments