Set max reading length 56/63856/1 accepted/tizen/common/20160329.050940 accepted/tizen/ivi/20160328.115840 accepted/tizen/mobile/20160328.115721 accepted/tizen/tv/20160328.115750 accepted/tizen/wearable/20160328.115843 submit/tizen/20160328.100804 submit/tizen/20160328.101155
authorKichan Kwon <k_c.kwon@samsung.com>
Mon, 28 Mar 2016 06:21:06 +0000 (15:21 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Mon, 28 Mar 2016 06:21:06 +0000 (15:21 +0900)
Change-Id: Ic23e693c62bcd81f2a8619986f52111c97c97b41
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/heart/decision-memory.c

index b6033c0..39ce772 100644 (file)
@@ -208,11 +208,13 @@ static void decision_memory_updated_cb(char *data)
        struct decision_item *di;
        unsigned pss, uss;
        int time, len;
+       char format[32];
 
        if (!data)
                return;
 
-       len = sscanf(data, "%s %s %d %u %u", appid, pkgname, &time, &pss, &uss);
+       snprintf(format, 32, "%%%ds %%%ds %%d %%u %%u", MAX_APPID_LENGTH, MAX_PKGNAME_LENGTH);
+       len = sscanf(data, format, appid, pkgname, &time, &pss, &uss);
        if (len < 0) {
                _E("sscanf failed");
                return;