raster pushed a commit to branch master.

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

commit 02a7e00c01ea727eaae6066b2cf1b075be7c3287
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Thu Mar 23 16:27:19 2017 +0900

    ecore_evas extn - fix buffer n check for lock files with untrusted val
    
    the code added by minkyoung has a definite security flaw here trusting
    e->response to be within a small range when all it is is an int -
    range is not limited other than that... so fix the code to check for
    range like further code below does.
    
    this commit went in 2 days ago... so not an existing bug fix.
---
 src/modules/ecore_evas/engines/extn/ecore_evas_extn.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c 
b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index af5f3de..16335da 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -1021,16 +1021,20 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void 
*event)
            {
               Ipc_Data_Update *ipc;
               int n = e->response;
+
               /* b->lockfd is not enough to ensure the size is same 
                * between what server knows, and client knows.
                * So should check file lock also. */
-              if (extn->b[n].buf && (!_extnbuf_lock_file_get(extn->b[n].buf)))
-                {  
-                   EINA_LIST_FREE(extn->file.updates, ipc)
+              if ((n >= 0) && (n < NBUF))
+                {
+                   if (extn->b[n].buf && 
(!_extnbuf_lock_file_get(extn->b[n].buf)))
                      {
-                        free(ipc);
+                        EINA_LIST_FREE(extn->file.updates, ipc)
+                          {
+                             free(ipc);
+                          }
+                        break;
                      }
-                   break;
                 }
 
               EINA_LIST_FREE(extn->file.updates, ipc)

-- 


Reply via email to