source: avoid potential buffer overflow of scanf 80/133480/1
authorSooyoung Ha <yoosah.ha@samsung.com>
Mon, 12 Jun 2017 10:50:04 +0000 (19:50 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Mon, 12 Jun 2017 10:50:04 +0000 (19:50 +0900)
Change-Id: I853dac8153041dc1786bb58f2058f31cba0a56e3
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
src/default_plugin_appcmd.c

index 7c0405e..2302386 100644 (file)
@@ -632,9 +632,9 @@ static void appcmd_receiver_packageinfo(int fd_in, int fd_out)
         }
 
         if (!strncmp(buf, "mainappid : ", 12)) {
-            sscanf(buf, "mainappid : %s", mainapp_id);
+            sscanf(buf, "mainappid : %127s", mainapp_id);
         } else if (!strncmp(buf, "Type: ", 6)) {
-            sscanf(buf, "Type: %s", type);
+            sscanf(buf, "Type: %127s", type);
         } else if (!strncmp(buf, "Removable: ", 11)) {
             sscanf(buf, "Removable: %d", &is_removable);
         } else if (strstr(buf, " is Running") != NULL) {