From 0b6e3455f9f7590402df02b972a471f639586582 Mon Sep 17 00:00:00 2001 From: "lakkyung.jung" Date: Mon, 23 Apr 2018 14:03:47 +0900 Subject: [PATCH] [COMMON] sched: ems: Use snprintf to fix buffer overflow. Change-Id: Ieebd6ca02aec141ca3eeb0366cf88778d94911ea Signed-off-by: lakkyung.jung --- kernel/sched/ems/lbt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1