elementary value provider: replace sprintf() with snprintf()
authorHermet Park <hermetpark@gmail.com>
Fri, 14 Feb 2020 08:22:53 +0000 (17:22 +0900)
committerHermet Park <hermetpark@gmail.com>
Fri, 14 Feb 2020 08:25:27 +0000 (17:25 +0900)
Avoid vulerable function usage in the test code

Change-Id: I1d53f54b8ed7a13072664b6d3a3e4e29bc3771d4

src/bin/elementary/test_efl_gfx_vg_value_provider.c

index d7c3af8..2b5c9ee 100644 (file)
@@ -280,17 +280,17 @@ void values_input(Eo* box, const char* type)
         char text[2][2];
         if (!strcmp(type, "TrPosition"))
           {
-             sprintf(text[0], "X");
-             sprintf(text[1], "Y");
+             snprintf(text[0], sizeof(text[0]), "X");
+             snprintf(text[1], sizeof(text[1]), "Y");
           }
         else if (!strcmp(type, "TrScale"))
           {
-             sprintf(text[0], "W");
-             sprintf(text[1], "H");
+             snprintf(text[0], sizeof(text[0]), "W");
+             snprintf(text[1], sizeof(text[1]), "H");
           }
         else if (!strcmp(type, "TrRotation"))
           {
-             sprintf(text[0], "R");
+             snprintf(text[0], sizeof(text[0]), "R");
           }
 
         int value_cnt = strstr(type, "Rotation") ? 1 : 2;