Skip to content

Commit

Permalink
Merge branch 'PHP-8.4'
Browse files Browse the repository at this point in the history
* PHP-8.4:
  Fix NULL arithmetic during system program execution
  • Loading branch information
cmb69 committed Jan 15, 2025
2 parents df8ac4a + 5f42cc9 commit 8d6f46d
Showing 1 changed file with 8 additions and 6 deletions.
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 8d6f46d

Please sign in to comment.