From ce67b392a82d61ff7f09869ea65448f31273b37d Mon Sep 17 00:00:00 2001 From: Subhransu Mohanty Date: Wed, 3 Jun 2020 11:17:18 +0900 Subject: [PATCH] ecore: Fix Asan stack overflow warning Summary: As argument can be passed by register (depending on the compiler optimization) when we take the adress of the nbytes and pass it to send() function which reades 4 bytes from it ASAN flags it as a stack overflow . So just assign the value to a local variable to avoid the warning. Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11914 --- src/lib/ecore/ecore_pipe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c index 4023bfa..e884494 100644 --- a/src/lib/ecore/ecore_pipe.c +++ b/src/lib/ecore/ecore_pipe.c @@ -204,6 +204,7 @@ ecore_pipe_write(Ecore_Pipe *p, size_t already_written = 0; int retry = ECORE_PIPE_WRITE_RETRY; Eina_Bool ok = EINA_FALSE; + unsigned int bytes = nbytes; if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { @@ -217,7 +218,7 @@ ecore_pipe_write(Ecore_Pipe *p, do // First write the len into the pipe { - ret = pipe_write(p->fd_write, &nbytes, sizeof(nbytes)); + ret = pipe_write(p->fd_write, &bytes, sizeof(bytes)); if (ret == sizeof(nbytes)) { retry = ECORE_PIPE_WRITE_RETRY; -- 2.7.4