main/SAPI: make "ini_entries" a const string

This commit is contained in:
Max Kellermann 2022-03-22 21:58:06 +01:00 committed by George Peter Banyard
parent 2d662f325d
commit d53ad4b566
3 changed files with 5 additions and 10 deletions

View file

@ -144,7 +144,8 @@ int fuzzer_init_php(const char *extra_ini)
if (extra_ini) {
ini_len += extra_ini_len + 1;
}
char *p = fuzzer_module.ini_entries = malloc(ini_len + 1);
char *p = malloc(ini_len + 1);
fuzzer_module.ini_entries = p;
memcpy(p, HARDCODED_INI, sizeof(HARDCODED_INI) - 1);
p += sizeof(HARDCODED_INI) - 1;
if (extra_ini) {
@ -234,7 +235,7 @@ int fuzzer_shutdown_php(void)
php_module_shutdown();
sapi_shutdown();
free(fuzzer_module.ini_entries);
free((void *)fuzzer_module.ini_entries);
return SUCCESS;
}