]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 30 Mar 2020 06:58:45 +0000 (08:58 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 30 Mar 2020 06:58:45 +0000 (08:58 +0200)
* PHP-7.4:
  Fix #79427: Integer Overflow in shmop_open()

1  2 
ext/shmop/shmop.c

index 446c3094582c0829424ad4c8e83311026a165670,07414f2bca7450e14620e4bcaab86ed215226c47..d718c429c94a0d64fdcdf5f77d2e2919dc2be332
@@@ -176,9 -207,14 +176,14 @@@ 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));
 +              php_error_docref(NULL, E_WARNING, "Unable to attach to shared memory segment '%s'", strerror(errno));
                goto err;
        }