File tree 3 files changed +5
-10
lines changed
3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ struct _sapi_module_struct {
262
262
void (* ini_defaults )(HashTable * configuration_hash );
263
263
int phpinfo_as_text ;
264
264
265
- char * ini_entries ;
265
+ const char * ini_entries ;
266
266
const zend_function_entry * additional_functions ;
267
267
unsigned int (* input_filter_init )(void );
268
268
};
Original file line number Diff line number Diff line change @@ -214,8 +214,7 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv)
214
214
* allocated so any INI settings added via this callback will have the
215
215
* lowest precedence and will allow INI files to overwrite them.
216
216
*/
217
- php_embed_module .ini_entries = malloc (sizeof (HARDCODED_INI ));
218
- memcpy (php_embed_module .ini_entries , HARDCODED_INI , sizeof (HARDCODED_INI ));
217
+ php_embed_module .ini_entries = HARDCODED_INI ;
219
218
220
219
/* SAPI-provided functions. */
221
220
php_embed_module .additional_functions = additional_functions ;
@@ -264,9 +263,4 @@ EMBED_SAPI_API void php_embed_shutdown(void)
264
263
#ifdef ZTS
265
264
tsrm_shutdown ();
266
265
#endif
267
-
268
- if (php_embed_module .ini_entries ) {
269
- free (php_embed_module .ini_entries );
270
- php_embed_module .ini_entries = NULL ;
271
- }
272
266
}
Original file line number Diff line number Diff line change @@ -144,7 +144,8 @@ int fuzzer_init_php(const char *extra_ini)
144
144
if (extra_ini ) {
145
145
ini_len += extra_ini_len + 1 ;
146
146
}
147
- char * p = fuzzer_module .ini_entries = malloc (ini_len + 1 );
147
+ char * p = malloc (ini_len + 1 );
148
+ fuzzer_module .ini_entries = p ;
148
149
memcpy (p , HARDCODED_INI , sizeof (HARDCODED_INI ) - 1 );
149
150
p += sizeof (HARDCODED_INI ) - 1 ;
150
151
if (extra_ini ) {
@@ -234,7 +235,7 @@ int fuzzer_shutdown_php(void)
234
235
php_module_shutdown ();
235
236
sapi_shutdown ();
236
237
237
- free (fuzzer_module .ini_entries );
238
+ free (( void * ) fuzzer_module .ini_entries );
238
239
return SUCCESS ;
239
240
}
240
241
You can’t perform that action at this time.
0 commit comments