edje/edje_cc: use strncpy() instead of strcpy().
authorHermet Park <hermet@hermet.pe.kr>
Wed, 21 Sep 2016 04:30:44 +0000 (13:30 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Wed, 21 Sep 2016 04:30:44 +0000 (13:30 +0900)
strncpy() is better for security.
Also, this change avoids annoying coverity detection.

src/bin/edje/edje_cc_parse.c

index 525c71d..efabe22 100644 (file)
@@ -391,7 +391,7 @@ next_token(char *p, char *end, char **new_p, int *delim)
              l = sscanf(tmpstr, "%*s %i \"%[^\"]\"", &nm, fl);
              if (l == 2)
                {
-                  strcpy(file_buf, fl);
+                  strncpy(file_buf, fl, sizeof(file_buf));
                   line = nm;
                   file_in = file_buf;
                }