Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] popen: add missing ev_io initialization
@ 2020-03-23  7:24 Cyrill Gorcunov
  2020-03-23 10:32 ` Nikita Pettik
  0 siblings, 1 reply; 4+ messages in thread
From: Cyrill Gorcunov @ 2020-03-23  7:24 UTC (permalink / raw)
  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 <korablev@tarantool.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-23 11:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23  7:24 [Tarantool-patches] [PATCH] popen: add missing ev_io initialization Cyrill Gorcunov
2020-03-23 10:32 ` Nikita Pettik
2020-03-23 10:44   ` Nikita Pettik
2020-03-23 11:09     ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox