From: Chanwoo Choi Date: Fri, 7 Aug 2020 06:22:56 +0000 (+0900) Subject: pmqos: Fix issue when the part of scenario name is same with supported scenario X-Git-Tag: submit/tizen/20200810.073747~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d34dc7968dedf5440decd21032cdb759cd0cb1c3;p=platform%2Fcore%2Fsystem%2Fpass.git pmqos: Fix issue when the part of scenario name is same with supported scenario If the part of scenario name sent from client is same with among the supported scenario name, strncmp() causes the issue. In order to fix this issue, compare the full scenario name with strcmp(): Change-Id: Ibc712b0b4be2cb752506ac7094b27abd88e587b5 Reported-by: Seung-Woo Kim Signed-off-by: Chanwoo Choi --- diff --git a/src/pmqos/pmqos.c b/src/pmqos/pmqos.c index e14e882..2ed67f7 100644 --- a/src/pmqos/pmqos.c +++ b/src/pmqos/pmqos.c @@ -175,8 +175,7 @@ static gboolean dbus_cb_pmqos_legacy_scenario(SystemPassPmqos *obj, for (i = 0; i < g_pmqos->num; i++) { name = g_pmqos->list[i].name; support = g_pmqos->list[i].support; - if (!strncmp(name, name_from, strlen(name)) && - support) { + if (!strcmp(name, name_from) && support) { ret = 0; break; } @@ -352,7 +351,7 @@ static int pmqos_cancel(const char *name) pmqos_head = g_list_remove(pmqos_head, (gconstpointer)cpu); free(cpu); - if (strncmp(unlock_timer_owner.name, name, strlen(name))) + if (strcmp(unlock_timer_owner.name, name)) goto out; /* undata cpu */ pmqos_unlock_timeout_update();