jaehyun pushed a commit to branch master.

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

commit 49fae1fe40b361027481cee9667543b3bafb1588
Author: taehyub <taehyub....@samsung.com>
Date:   Mon Mar 7 12:13:07 2016 +0900

    text_setting: fix the unsafe code of string function
    
    Summary:
    fix the unsafe code like strcat and strcpy.
    it is changed to strncpy, strncat
    
    @fix
    
    Reviewers: Hermet, NikaWhite, Jaehyun_Cho
    
    Differential Revision: https://phab.enlightenment.org/D3761
---
 src/bin/text_setting.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/text_setting.c b/src/bin/text_setting.c
index 4dc58d1..f611761 100644
--- a/src/bin/text_setting.c
+++ b/src/bin/text_setting.c
@@ -181,7 +181,7 @@ text_setting_syntax_color_update(Evas_Object *ctxpopup,
                                              "elm.swallow.slider");
         snprintf(buf, sizeof(buf), "%02X",
                  (int) roundf(elm_slider_value_get(slider)));
-        strcat(color, buf);
+        strncat(color, buf, strlen(buf));
      }
    color[SYNTAX_COLOR_LEN - 1] = '\0';
 
@@ -417,7 +417,7 @@ syntax_template_format_create(void)
 
    char *syntax_template_format = calloc(1, sizeof(char) * (strlen(utf8) + 1));
    if (!syntax_template_format) goto err;
-   strcpy(syntax_template_format, utf8);
+   strncpy(syntax_template_format, utf8, strlen(utf8) + 1);
 
    tsd->syntax_template_format = syntax_template_format;
 

-- 


Reply via email to