Skip to content

Commit a32c563

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
2 parents f7b573b + cfdd828 commit a32c563

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ PHP NEWS
1616
- Opcache:
1717
. Fixed bug #76832 (ZendOPcache.MemoryBase periodically deleted by the OS).
1818
(Anatol)
19+
. Fixed bug #76796 (Compile-time evaluation of disabled function in opcache
20+
causes segfault). (Nikita)
1921

2022
- POSIX:
2123
Fixed bug #75696 (posix_getgrnam fails to print details of group). (cmb)

ext/opcache/Optimizer/sccp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,8 @@ static inline int ct_eval_func_call(
953953
}
954954

955955
func = zend_hash_find_ptr(CG(function_table), name);
956-
if (!func || func->type != ZEND_INTERNAL_FUNCTION) {
956+
if (!func || func->type != ZEND_INTERNAL_FUNCTION
957+
|| func->internal_function.handler == ZEND_FN(display_disabled_function)) {
957958
return FAILURE;
958959
}
959960

ext/opcache/tests/bug76796.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #76796: Compile-time evaluation of disabled function in opcache (SCCP) causes segfault
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.optimization_level=-1
7+
disable_functions=strpos
8+
--FILE--
9+
<?php
10+
11+
var_dump(strpos('foo', 'bar'));
12+
13+
?>
14+
--EXPECTF--
15+
Warning: strpos() has been disabled for security reasons in %s on line %d
16+
NULL

0 commit comments

Comments
 (0)