Skip to content

Commit b37dafc

Browse files
cmb69weltling
authored andcommitted
Add test for PR #2382
1 parent 1870a61 commit b37dafc

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
strnat(case)cmp(): potential OOB access for unterminated strings
3+
--SKIPIF--
4+
<?php
5+
if (!function_exists('zend_create_unterminated_string')) die('skip zend_test extension not available');
6+
?>
7+
--FILE--
8+
<?php
9+
$a = zend_create_unterminated_string('333');
10+
$b = zend_create_unterminated_string('333 ');
11+
var_dump(
12+
strnatcmp($a, $b),
13+
strnatcasecmp($b, $a)
14+
);
15+
zend_terminate_string($a);
16+
zend_terminate_string($b);
17+
?>
18+
===DONE===
19+
--EXPECT--
20+
int(-1)
21+
int(1)
22+
===DONE===

0 commit comments

Comments
 (0)