Skip to content

Commit c3c270f

Browse files
committed
stream: fix segfault with incompletely zeroed entry in dtor
1 parent 746c197 commit c3c270f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

main/streams/stream_errors.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,14 +681,13 @@ static void php_stream_wrapper_log_store_error(zend_string *message, int code,
681681
{
682682
char *param_copy = param ? estrdup(param) : NULL;
683683

684-
php_stream_error_entry *entry = emalloc(sizeof(php_stream_error_entry));
684+
php_stream_error_entry *entry = ecalloc(1, sizeof(php_stream_error_entry));
685685
entry->message = message;
686686
entry->code = code;
687687
entry->wrapper_name = wrapper_name ? estrdup(wrapper_name) : NULL;
688688
entry->param = param_copy;
689689
entry->severity = severity;
690690
entry->terminating = terminating;
691-
entry->next = NULL;
692691

693692
if (!FG(wrapper_logged_errors)) {
694693
ALLOC_HASHTABLE(FG(wrapper_logged_errors));

0 commit comments

Comments
 (0)