From 186bea594d970b4d1dda03a8ca288df26fbc76d3 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Mon, 12 Jun 2017 19:50:04 +0900 Subject: [PATCH] source: avoid potential buffer overflow of scanf Change-Id: I853dac8153041dc1786bb58f2058f31cba0a56e3 Signed-off-by: Sooyoung Ha --- src/default_plugin_appcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/default_plugin_appcmd.c b/src/default_plugin_appcmd.c index 7c0405e..2302386 100644 --- a/src/default_plugin_appcmd.c +++ b/src/default_plugin_appcmd.c @@ -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) { -- 2.7.4