Restored zeroing of ngx_channel_t in ngx_pass_open_channel().

Due to structure's alignment, some uninitialized memory contents may have
been passed between processes.

Zeroing was removed in 0215ec9aaa8a.

Reported by Johnny Wang.
This commit is contained in:
Ruslan Ermilov 2021-04-22 16:12:52 +03:00
parent 7b9920aad8
commit f02e2a734e

View File

@ -398,6 +398,8 @@ ngx_pass_open_channel(ngx_cycle_t *cycle)
ngx_int_t i;
ngx_channel_t ch;
ngx_memzero(&ch, sizeof(ngx_channel_t));
ch.command = NGX_CMD_OPEN_CHANNEL;
ch.pid = ngx_processes[ngx_process_slot].pid;
ch.slot = ngx_process_slot;