Skip to content

Commit 02b1056

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix is_zend_ptr() huge block comparison
2 parents e43a398 + 18674e3 commit 02b1056

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ PHP NEWS
1414
(nielsdos)
1515
. Fixed bug GH-16630 (UAF in lexer with encoding translation and heredocs).
1616
(nielsdos)
17+
. Fix is_zend_ptr() huge block comparison. (nielsdos)
1718

1819
- Curl:
1920
. Fixed bug GH-16802 (open_basedir bypass using curl extension). (nielsdos)

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,8 +2471,8 @@ ZEND_API bool is_zend_ptr(const void *ptr)
24712471

24722472
zend_mm_huge_list *block = AG(mm_heap)->huge_list;
24732473
while (block) {
2474-
if (ptr >= (void*)block
2475-
&& ptr < (void*)((char*)block + block->size)) {
2474+
if (ptr >= block->ptr
2475+
&& ptr < (void*)((char*)block->ptr + block->size)) {
24762476
return 1;
24772477
}
24782478
block = block->next;

0 commit comments

Comments
 (0)