hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e94b5d014f42f53bbcc0e3c12693c801a78f9fcf

commit e94b5d014f42f53bbcc0e3c12693c801a78f9fcf
Author: Subhransu Mohanty <smohan...@gmail.com>
Date:   Wed Jun 3 11:17:18 2020 +0900

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

-- 


Reply via email to