Skip to content

Commit 8eccf87

Browse files
committed
Fix use after free
1 parent 1674a4c commit 8eccf87

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

ext/standard/assert.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ PHP_FUNCTION(assert)
167167
call_user_function(NULL, NULL, &ASSERTG(callback), &retval, 3, args);
168168
}
169169

170-
zval_ptr_dtor(&args[0]);
171170
zval_ptr_dtor(&retval);
172171
}
173172

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
assert() asserting multiple with callback
3+
--INI--
4+
assert.active = 1
5+
assert.warning = 1
6+
assert.bail = 0
7+
assert.exception=1
8+
--FILE--
9+
<?php
10+
assert_options(ASSERT_CALLBACK, function ($f) {});
11+
try {
12+
assert(false);
13+
} catch (Throwable) {}
14+
try {
15+
assert(false);
16+
} catch (Throwable) {}
17+
try {
18+
assert(false);
19+
} catch (Throwable) {}
20+
try {
21+
assert(false);
22+
} catch (Throwable) {}
23+
try {
24+
assert(false);
25+
} catch (Throwable) {}
26+
try {
27+
assert(false);
28+
} catch (Throwable) {}
29+
try {
30+
assert(false);
31+
} catch (Throwable) {}
32+
?>
33+
DONE
34+
--EXPECT--
35+
DONE

0 commit comments

Comments
 (0)