[<prev] [next>] [day] [month] [year] [list]
Message-ID: <51A2F342.8060907@asianux.com>
Date: Mon, 27 May 2013 13:46:42 +0800
From: Chen Gang <gang.chen@...anux.com>
To: "dhowells@...hat.com" <dhowells@...hat.com>,
jesper.nilsson@...s.com, Richard Kuo <rkuo@...eaurora.org>,
Tejun Heo <tj@...nel.org>
CC: Andrew Morton <akpm@...ux-foundation.org>,
David Miller <davem@...emloft.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux-Arch <linux-arch@...r.kernel.org>
Subject: [PATCH] arch: frv: kernel: using vsnprintf() instead of vsprintf()
Since die_if_kernel() is an extern common used function, better always
check the buffer length to avoid memory overflow by a long 'str'.
Signed-off-by: Chen Gang <gang.chen@...anux.com>
---
arch/frv/kernel/traps.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c
index 4bff48c..a6d105d 100644
--- a/arch/frv/kernel/traps.c
+++ b/arch/frv/kernel/traps.c
@@ -523,7 +523,7 @@ void die_if_kernel(const char *str, ...)
return;
va_start(va, str);
- vsprintf(buffer, str, va);
+ vsnprintf(buffer, sizeof(buffer), str, va);
va_end(va);
console_verbose();
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists