summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-12-30 15:17:03 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2019-12-30 15:17:41 +0100
commit94063619a0d521fec05b49e6aa35d8004c4d29f0 (patch)
treee578bbba4ed0f8be30bafaa877331834e352ebab
parentfcaf7cbd641dcbccdd5c6218a26abb34f7b6ff23 (diff)
parent0cecf83b264cbbb5683ab8a843cc4a4d9c294644 (diff)
downloadphp-git-94063619a0d521fec05b49e6aa35d8004c4d29f0.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79040: Warning Opcode handlers are unusable due to ASLR
-rw-r--r--NEWS1
-rw-r--r--ext/opcache/shared_alloc_win32.c9
2 files changed, 6 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 464ac3d885..d99c3d5a2d 100644
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,7 @@ PHP NEWS
(Nikita)
. Fixed bug #78986 (Opcache segfaults when inheriting ctor from immutable
into mutable class). (Nikita)
+ . Fixed bug #79040 (Warning Opcode handlers are unusable due to ASLR). (cmb)
- Pcntl:
. Fixed bug #78402 (Converting null to string in error message is bad DX).
diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c
index 35abe367cf..d2c31dd63b 100644
--- a/ext/opcache/shared_alloc_win32.c
+++ b/ext/opcache/shared_alloc_win32.c
@@ -24,6 +24,7 @@
#include "zend_shared_alloc.h"
#include "zend_accelerator_util_funcs.h"
#include "zend_execute.h"
+#include "SAPI.h"
#include "tsrm_win32.h"
#include "win32/winutil.h"
#include <winbase.h>
@@ -68,15 +69,15 @@ static void zend_win_error_message(int type, char *msg, int err)
static char *create_name_with_username(char *name)
{
- static char newname[MAXPATHLEN + 32 + 4 + 1 + 32];
- snprintf(newname, sizeof(newname) - 1, "%s@%.32s@%.32s", name, accel_uname_id, accel_system_id);
+ static char newname[MAXPATHLEN + 32 + 4 + 1 + 32 + 21];
+ snprintf(newname, sizeof(newname) - 1, "%s@%.32s@%.20s@%.32s", name, accel_uname_id, sapi_module.name, accel_system_id);
return newname;
}
static char *get_mmap_base_file(void)
{
- static char windir[MAXPATHLEN+ 32 + 3 + sizeof("\\\\@") + 1 + 32];
+ static char windir[MAXPATHLEN+ 32 + 3 + sizeof("\\\\@") + 1 + 32 + 21];
int l;
GetTempPath(MAXPATHLEN, windir);
@@ -85,7 +86,7 @@ static char *get_mmap_base_file(void)
l--;
}
- snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%.32s@%.32s", ACCEL_FILEMAP_BASE, accel_uname_id, accel_system_id);
+ snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%.32s@%.20s@%.32s", ACCEL_FILEMAP_BASE, accel_uname_id, sapi_module.name, accel_system_id);
return windir;
}