jaehyun pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=d86d1f38ee67b1e402f6db57437a9fd339fbaddf

commit d86d1f38ee67b1e402f6db57437a9fd339fbaddf
Author: taehyub <taehyub....@samsung.com>
Date:   Fri Mar 4 16:05:16 2016 +0900

    ctxpopup.c: change strcat function to strncat function
    
    Summary:
    change strcat to strncat for code safe
    
    @fix
    
    Reviewers: Hermet, Jaehyun_Cho
    
    Differential Revision: https://phab.enlightenment.org/D3755
---
 src/lib/ctxpopup.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lib/ctxpopup.c b/src/lib/ctxpopup.c
index 8f0928b..09bb3f8 100644
--- a/src/lib/ctxpopup.c
+++ b/src/lib/ctxpopup.c
@@ -167,9 +167,10 @@ slider_changed_cb(void *data, Evas_Object *obj, void 
*event_info EINA_UNUSED)
              else
                snprintf(buf, sizeof(buf), " %0.2f", val);
           }
-        strcat(ctxdata->candidate, buf);
+        strncat(ctxdata->candidate, buf, strlen(buf));
      }
-   strcat(ctxdata->candidate, ctxdata->attr->append_str);
+   strncat(ctxdata->candidate, ctxdata->attr->append_str,
+           strlen(ctxdata->attr->append_str));
    ecore_animator_del(ctxdata->animator);
    ctxdata->animator = ecore_animator_add(changed_animator_cb, ctxdata);
 }
@@ -219,9 +220,10 @@ toggle_changed_cb(void *data, Evas_Object *obj EINA_UNUSED,
    EINA_LIST_FOREACH(ctxdata->toggles, l, toggle)
      {
         snprintf(buf, sizeof(buf), " %d", (int) elm_check_state_get(toggle));
-        strcat(ctxdata->candidate, buf);
+        strncat(ctxdata->candidate, buf, strlen(buf));
      }
-   strcat(ctxdata->candidate, ctxdata->attr->append_str);
+   strncat(ctxdata->candidate, ctxdata->attr->append_str,
+           strlen(ctxdata->attr->append_str));
    ctxdata->changed_cb(ctxdata->data, ctxdata->ctxpopup, ctxdata->candidate);
 }
 

-- 


Reply via email to