raster pushed a commit to branch master.

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

commit c7a22fb2c79f638c5b3194c6fcf677a94f65af4d
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Thu Nov 8 15:05:37 2018 +0000

    edje player - fix ridiculous use of srncat
    
    another case of blind strncat usage rthat seemingly did a:
    
    strcat(buf, str); -> strncat(buf, str, strlen(tr));
    
    which is the most pointless thing to do ever. it's no better. it's
    worse as it makes it harder to identify issues. thanks these days
    compilers warn about this as a stupid thing to do... so i looked at it
    and fixed it properly.
    
    again - don't do this stuff above - it's pointless. patches that do
    this should be rejected. fix it properly or leave it as-is.
---
 src/bin/edje/edje_player.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/bin/edje/edje_player.c b/src/bin/edje/edje_player.c
index 079495a174..34c1de1685 100644
--- a/src/bin/edje/edje_player.c
+++ b/src/bin/edje/edje_player.c
@@ -846,11 +846,14 @@ _edje_circul(void *data, Evas_Object *obj EINA_UNUSED, 
void *event_info)
    char *group = data;
 
    part_name = eina_list_data_get(eina_list_last(parts));
-   strncat(buf, part_name, strlen(part_name));
+   strncat(buf, part_name, sizeof(buf) - 1);
+   part_name[sizeof(buf) - 1] = 0;
    EINA_LIST_FOREACH(parts, l, part_name)
      {
-        strncat(buf, " -> ", strlen(" -> "));
-        strncat(buf, part_name, strlen(part_name));
+        strncat(buf, " -> ", sizeof(buf) - strlen(buf) - 1);
+        part_name[sizeof(buf) - 1] = 0;
+        strncat(buf, part_name, sizeof(buf) - strlen(buf) - 1);
+        part_name[sizeof(buf) - 1] = 0;
      }
 
    fprintf(stderr, "Group '%s' have a circul dependency between parts: %s\n",

-- 


Reply via email to