Skip to content

Commit

Permalink
Merge branch 'PHP-8.3' into PHP-8.4
Browse files Browse the repository at this point in the history
* PHP-8.3:
  Fix NULL arithmetic during system program execution
  • Loading branch information
cmb69 committed Jan 15, 2025
2 parents 6979a7a + 022a5fc commit 5f42cc9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ PHP NEWS
constant expression contexts). (ilutov)
. Fixed bug GH-17214 (Relax final+private warning for trait methods with
inherited final). (ilutov)
. Fixed NULL arithmetic during system program execution on Windows. (cmb,
nielsdos)

- DOM:
. Fixed bug GH-17397 (Assertion failure ext/dom/php_dom.c). (nielsdos)
Expand Down
14 changes: 8 additions & 6 deletions TSRM/tsrm_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,16 @@ static process_pair *process_get(FILE *stream)
process_pair *ptr;
process_pair *newptr;

for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) {
if (ptr->stream == stream) {
break;
if (TWG(process) != NULL) {
for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) {
if (ptr->stream == stream) {
break;
}
}
}

if (ptr < (TWG(process) + TWG(process_size))) {
return ptr;
if (ptr < (TWG(process) + TWG(process_size))) {
return ptr;
}
}

newptr = (process_pair*)realloc((void*)TWG(process), (TWG(process_size)+1)*sizeof(process_pair));
Expand Down

0 comments on commit 5f42cc9

Please sign in to comment.