From f7458a4d747f9759bfce86dd51814bd9e08c9da9 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 30 Jan 2011 21:41:44 +0100 Subject: [PATCH] --- yaml --- r: 234149 b: refs/heads/master c: 994fed2dd2166f86b62ec53c7424660145f138ee h: refs/heads/master i: 234147: 98a47018a65864e01b17499b089564cf32faee1a v: v3 --- [refs] | 2 +- trunk/arch/mips/loongson/common/machtype.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index d5cceaa9e8d5..aaa28129fb14 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d3ce0e98b7fe17bb1dec9f6d7c50213db01e7189 +refs/heads/master: 994fed2dd2166f86b62ec53c7424660145f138ee diff --git a/trunk/arch/mips/loongson/common/machtype.c b/trunk/arch/mips/loongson/common/machtype.c index 81fbe6b73f91..2efd5d9dee27 100644 --- a/trunk/arch/mips/loongson/common/machtype.c +++ b/trunk/arch/mips/loongson/common/machtype.c @@ -41,7 +41,7 @@ void __weak __init mach_prom_init_machtype(void) void __init prom_init_machtype(void) { - char *p, str[MACHTYPE_LEN]; + char *p, str[MACHTYPE_LEN + 1]; int machtype = MACH_LEMOTE_FL2E; mips_machtype = LOONGSON_MACHTYPE; @@ -53,6 +53,7 @@ void __init prom_init_machtype(void) } p += strlen("machtype="); strncpy(str, p, MACHTYPE_LEN); + str[MACHTYPE_LEN] = '\0'; p = strstr(str, " "); if (p) *p = '\0';