raster pushed a commit to branch master.

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

commit b9b0177d5e0f2b3a03f77e04c64de534b2c786ac
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Thu Jun 8 11:54:15 2017 +0900

    elm_prefs_cc: handle line too long for buffers
    
    if a line from the cpp processor is too long (more than 4k) then abort
    compilation as something is wrong asnd our buffers can't handle it
    anyway.
    
    @fix
---
 src/bin/elementary/elm_prefs_cc_parse.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/bin/elementary/elm_prefs_cc_parse.c 
b/src/bin/elementary/elm_prefs_cc_parse.c
index 5fda91eed1..e3002fc69c 100644
--- a/src/bin/elementary/elm_prefs_cc_parse.c
+++ b/src/bin/elementary/elm_prefs_cc_parse.c
@@ -296,6 +296,11 @@ next_token(char *p, char *end, char **new_p, int *delim)
                }
              strncpy(tmpstr, p, l);
              tmpstr[l] = 0;
+             if (l >= sizeof(fl))
+               {
+                  ERR("Line too long: %i chars: %s", l, tmpstr);
+                  exit(-1);
+               }
              l = sscanf(tmpstr, "%*s %i \"%[^\"]\"", &nm, fl);
              if (l == 2)
                {

-- 


Reply via email to