[PATCH] fix uninitialized string in get_model_name()

From: Stephane Eranian <eranian_at_hpl.hp.com>
Date: 2006-12-02 03:30:35
Hello,

If ia64_pal_get_brand_info() fails in get_model_name() we may be copying
an invalid string.

changelog:
	- initialize brand[] in get_model_name()

signed-off-by: stephane eranian <eranian@hpl.hp.com>

diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 2fd4b7d..cc82f6a 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -616,6 +616,8 @@ get_model_name(__u8 family, __u8 model)
 {
 	char brand[128];
 
+	memset(brand, 0, sizeof(brand));
+
 	if (ia64_pal_get_brand_info(brand)) {
 		if (family == 0x7)
 			memcpy(brand, "Merced", 7);
-- 

-Stephane
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Dec 02 03:31:02 2006

This archive was generated by hypermail 2.1.8 : 2006-12-02 03:31:15 EST