From: Sooyoung Ha Date: Mon, 12 Jun 2017 10:50:04 +0000 (+0900) Subject: source: avoid potential buffer overflow of scanf X-Git-Tag: submit/tizen/20170612.121331~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F133480%2F1;p=sdk%2Ftarget%2Fsdbd.git source: avoid potential buffer overflow of scanf Change-Id: I853dac8153041dc1786bb58f2058f31cba0a56e3 Signed-off-by: Sooyoung Ha --- 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) {