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
This commit is contained in:
Subhransu Mohanty 2020-06-03 11:17:18 +09:00 committed by Hermet Park
parent 7e1da90093
commit e94b5d014f
1 changed files with 2 additions and 1 deletions

View File

@ -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;