diff options
author | Subhransu Mohanty <smohantty@gmail.com> | 2020-06-03 11:17:18 +0900 |
---|---|---|
committer | Hermet Park <chuneon.park@samsung.com> | 2020-06-03 11:17:18 +0900 |
commit | e94b5d014f42f53bbcc0e3c12693c801a78f9fcf (patch) | |
tree | 33608395268518efcd048e2318c457923b7b8fbc | |
parent | 7e1da900934fcb2d837c65bafe1d086d54830803 (diff) | |
download | efl-e94b5d014f42f53bbcc0e3c12693c801a78f9fcf.tar.gz |
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
-rw-r--r-- | src/lib/ecore/ecore_pipe.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c index 4023bfa70f..e884494605 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; |