From: lakkyung.jung Date: Mon, 23 Apr 2018 05:03:47 +0000 (+0900) Subject: [COMMON] sched: ems: Use snprintf to fix buffer overflow. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0b6e3455f9f7590402df02b972a471f639586582;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] sched: ems: Use snprintf to fix buffer overflow. Change-Id: Ieebd6ca02aec141ca3eeb0366cf88778d94911ea Signed-off-by: lakkyung.jung --- diff --git a/kernel/sched/ems/lbt.c b/kernel/sched/ems/lbt.c index 75ef7ebd8531..5104b4f74790 100644 --- a/kernel/sched/ems/lbt.c +++ b/kernel/sched/ems/lbt.c @@ -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;