mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix opcache path determination, again
We shouldn't be appending to the executable path, but rather to the directory of the executable.
This commit is contained in:
parent
0eb5c1a018
commit
a12aee5cb3
2 changed files with 8 additions and 1 deletions
|
@ -138,6 +138,13 @@ ZEND_ATTRIBUTE_UNUSED char *get_opcache_path(void) {
|
|||
ZEND_ASSERT(0 && "Failed to get binary path");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Get basename. */
|
||||
char *last_sep = strrchr(path, '/');
|
||||
if (last_sep) {
|
||||
*last_sep = '\0';
|
||||
}
|
||||
|
||||
strlcat(path, "/modules/opcache.so", sizeof(path));
|
||||
return realpath(path, NULL);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) {
|
|||
char *opcache_path = get_opcache_path();
|
||||
assert(opcache_path && "Failed to determine opcache path");
|
||||
|
||||
char ini_buf[256];
|
||||
char ini_buf[512];
|
||||
snprintf(ini_buf, sizeof(ini_buf),
|
||||
"zend_extension=%s\n"
|
||||
"opcache.validate_timestamps=0\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue