Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Fix potential NULL pointer dereference Windows shm*() functions
This commit is contained in:
Christoph M. Becker 2022-11-02 14:52:52 +01:00
commit 8bf6266e65
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
2 changed files with 4 additions and 3 deletions

1
NEWS
View file

@ -10,6 +10,7 @@ PHP NEWS
evaluation with extra named params). (Arnaud)
. Fixed bug GH-9801 (Generator crashes when memory limit is exceeded during
initialization). (Arnaud)
. Fixed potential NULL pointer dereference Windows shm*() functions. (cmb)
- Date:
. Fixed bug GH-9763 (DateTimeZone ctr mishandles input and adds null byte if

View file

@ -702,7 +702,7 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{/*{{{*/
shm_pair *shm = shm_get(key, NULL);
if (!shm->segment) {
if (!shm || !shm->segment) {
return (void*)-1;
}
@ -726,7 +726,7 @@ TSRM_API int shmdt(const void *shmaddr)
shm_pair *shm = shm_get(0, (void*)shmaddr);
int ret;
if (!shm->segment) {
if (!shm || !shm->segment) {
return -1;
}
@ -746,7 +746,7 @@ TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
{/*{{{*/
shm_pair *shm = shm_get(key, NULL);
if (!shm->segment) {
if (!shm || !shm->segment) {
return -1;
}