Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79427: Integer Overflow in shmop_open()
This commit is contained in:
Christoph M. Becker 2020-03-30 08:57:29 +02:00
commit 6f8045c47f
2 changed files with 8 additions and 0 deletions

3
NEWS
View file

@ -25,6 +25,9 @@ PHP NEWS
. Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script).
(Dmitry)
- Shmop:
. Fixed bug #79427 (Integer Overflow in shmop_open()). (cmb)
- SimpleXML:
. Fixed bug #61597 (SXE properties may lack attributes and content). (cmb)

View file

@ -207,6 +207,11 @@ PHP_FUNCTION(shmop_open)
goto err;
}
if (shm.shm_segsz > ZEND_LONG_MAX) {
php_error_docref(NULL, E_WARNING, "shared memory segment too large to attach");
goto err;
}
shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg);
if (shmop->addr == (char*) -1) {
php_error_docref(NULL, E_WARNING, "unable to attach to shared memory segment '%s'", strerror(errno));