Skip to content

Commit e57b2b9

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #79040: Warning Opcode handlers are unusable due to ASLR
2 parents f13d0a7 + 9406361 commit e57b2b9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/opcache/shared_alloc_win32.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "zend_shared_alloc.h"
2525
#include "zend_accelerator_util_funcs.h"
2626
#include "zend_execute.h"
27+
#include "SAPI.h"
2728
#include "tsrm_win32.h"
2829
#include "win32/winutil.h"
2930
#include <winbase.h>
@@ -68,15 +69,15 @@ static void zend_win_error_message(int type, char *msg, int err)
6869

6970
static char *create_name_with_username(char *name)
7071
{
71-
static char newname[MAXPATHLEN + 32 + 4 + 1 + 32];
72-
snprintf(newname, sizeof(newname) - 1, "%s@%.32s@%.32s", name, accel_uname_id, accel_system_id);
72+
static char newname[MAXPATHLEN + 32 + 4 + 1 + 32 + 21];
73+
snprintf(newname, sizeof(newname) - 1, "%s@%.32s@%.20s@%.32s", name, accel_uname_id, sapi_module.name, accel_system_id);
7374

7475
return newname;
7576
}
7677

7778
static char *get_mmap_base_file(void)
7879
{
79-
static char windir[MAXPATHLEN+ 32 + 3 + sizeof("\\\\@") + 1 + 32];
80+
static char windir[MAXPATHLEN+ 32 + 3 + sizeof("\\\\@") + 1 + 32 + 21];
8081
int l;
8182

8283
GetTempPath(MAXPATHLEN, windir);
@@ -85,7 +86,7 @@ static char *get_mmap_base_file(void)
8586
l--;
8687
}
8788

88-
snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%.32s@%.32s", ACCEL_FILEMAP_BASE, accel_uname_id, accel_system_id);
89+
snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%.32s@%.20s@%.32s", ACCEL_FILEMAP_BASE, accel_uname_id, sapi_module.name, accel_system_id);
8990

9091
return windir;
9192
}

0 commit comments

Comments
 (0)