[COMMON] sched: ems: Use snprintf to fix buffer overflow.
authorlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Apr 2018 05:03:47 +0000 (14:03 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:35:56 +0000 (17:35 +0900)
Change-Id: Ieebd6ca02aec141ca3eeb0366cf88778d94911ea
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
kernel/sched/ems/lbt.c

index 75ef7ebd8531160f85f093e4407e2f36698006c1..5104b4f7479013a4e1b59c848df8b0d2c89db82f 100644 (file)
@@ -220,10 +220,10 @@ static int __init lbt_sysfs_init(void)
                goto out;
 
        for (i = 0; i <= depth; i++) {
-               char buf[20];
+               char buf[25];
                char *name;
 
-               sprintf(buf, "overutil_ratio_level%d", i);
+               scnprintf(buf, sizeof(buf), "overutil_ratio_level%d", i);
                name = kstrdup(buf, GFP_KERNEL);
                if (!name)
                        goto out;