From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id DEAF94696C3 for ; Mon, 23 Mar 2020 10:24:50 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id n20so9362501lfl.10 for ; Mon, 23 Mar 2020 00:24:50 -0700 (PDT) From: Cyrill Gorcunov Date: Mon, 23 Mar 2020 10:24:44 +0300 Message-Id: <20200323072444.24660-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] popen: add missing ev_io initialization List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Otherwise it left unitialized and in result may not work depending on dirty data got from memory. Fixes #4811 Reported-by: Nikita Pettik Signed-off-by: Cyrill Gorcunov --- branch gorcunov/gh-4811-popen-coio src/lib/core/popen.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index a0630e3d9..99bd69b74 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -115,12 +115,8 @@ handle_new(struct popen_opts *opts) rlist_create(&handle->list); - /* - * No need to initialize the whole ios structure, - * just set fd value to mark as unused. - */ for (i = 0; i < lengthof(handle->ios); i++) - handle->ios[i].fd = -1; + coio_create(&handle->ios[i], -1); say_debug("popen: alloc handle %p command '%s' flags %#x", handle, handle->command, opts->flags); -- 2.20.1