File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1257,6 +1257,7 @@ PHP_FUNCTION(zip_read)
1257
1257
1258
1258
zr_rsrc -> zf = zip_fopen_index (rsrc_int -> za , rsrc_int -> index_current , 0 );
1259
1259
if (zr_rsrc -> zf ) {
1260
+ Z_ADDREF_P (zip_dp );
1260
1261
rsrc_int -> index_current ++ ;
1261
1262
RETURN_RES (zend_register_resource (zr_rsrc , le_zip_entry ));
1262
1263
} else {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-17139 - zip_entry_name() crash
3
+ --EXTENSIONS--
4
+ zip
5
+ --FILE--
6
+ <?php
7
+ $ zip = zip_open (__DIR__ ."/test_procedural.zip " );
8
+ if (!is_resource ($ zip )) die ("Failure " );
9
+ // no need to bother looping over, the entry name should point to a dangling address from the first iteration
10
+ $ zip = zip_read ($ zip );
11
+ var_dump (zip_entry_name ($ zip ));
12
+ ?>
13
+ --EXPECTF--
14
+ Deprecated: Function zip_open() is deprecated in %s on line %d
15
+
16
+ Deprecated: Function zip_read() is deprecated in %s on line %d
17
+
18
+ Deprecated: Function zip_entry_name() is deprecated in %s on line %d
19
+ string(3) "foo"
You can’t perform that action at this time.
0 commit comments