mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
main/SAPI: make "ini_entries" a const string
This commit is contained in:
parent
2d662f325d
commit
d53ad4b566
3 changed files with 5 additions and 10 deletions
|
@ -262,7 +262,7 @@ struct _sapi_module_struct {
|
||||||
void (*ini_defaults)(HashTable *configuration_hash);
|
void (*ini_defaults)(HashTable *configuration_hash);
|
||||||
int phpinfo_as_text;
|
int phpinfo_as_text;
|
||||||
|
|
||||||
char *ini_entries;
|
const char *ini_entries;
|
||||||
const zend_function_entry *additional_functions;
|
const zend_function_entry *additional_functions;
|
||||||
unsigned int (*input_filter_init)(void);
|
unsigned int (*input_filter_init)(void);
|
||||||
};
|
};
|
||||||
|
|
|
@ -214,8 +214,7 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv)
|
||||||
* allocated so any INI settings added via this callback will have the
|
* allocated so any INI settings added via this callback will have the
|
||||||
* lowest precedence and will allow INI files to overwrite them.
|
* lowest precedence and will allow INI files to overwrite them.
|
||||||
*/
|
*/
|
||||||
php_embed_module.ini_entries = malloc(sizeof(HARDCODED_INI));
|
php_embed_module.ini_entries = HARDCODED_INI;
|
||||||
memcpy(php_embed_module.ini_entries, HARDCODED_INI, sizeof(HARDCODED_INI));
|
|
||||||
|
|
||||||
/* SAPI-provided functions. */
|
/* SAPI-provided functions. */
|
||||||
php_embed_module.additional_functions = additional_functions;
|
php_embed_module.additional_functions = additional_functions;
|
||||||
|
@ -264,9 +263,4 @@ EMBED_SAPI_API void php_embed_shutdown(void)
|
||||||
#ifdef ZTS
|
#ifdef ZTS
|
||||||
tsrm_shutdown();
|
tsrm_shutdown();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (php_embed_module.ini_entries) {
|
|
||||||
free(php_embed_module.ini_entries);
|
|
||||||
php_embed_module.ini_entries = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,8 @@ int fuzzer_init_php(const char *extra_ini)
|
||||||
if (extra_ini) {
|
if (extra_ini) {
|
||||||
ini_len += extra_ini_len + 1;
|
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);
|
memcpy(p, HARDCODED_INI, sizeof(HARDCODED_INI) - 1);
|
||||||
p += sizeof(HARDCODED_INI) - 1;
|
p += sizeof(HARDCODED_INI) - 1;
|
||||||
if (extra_ini) {
|
if (extra_ini) {
|
||||||
|
@ -234,7 +235,7 @@ int fuzzer_shutdown_php(void)
|
||||||
php_module_shutdown();
|
php_module_shutdown();
|
||||||
sapi_shutdown();
|
sapi_shutdown();
|
||||||
|
|
||||||
free(fuzzer_module.ini_entries);
|
free((void *)fuzzer_module.ini_entries);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue