linux/arch/mips/loongson/common
Stefan Weil 994fed2dd2 MIPS: Loongson: Fix potentially wrong string handling
This error was reported by cppcheck:
arch/mips/loongson/common/machtype.c:56: error: Dangerous usage of 'str' (strncpy doesn't always 0-terminate it)

If strncpy copied MACHTYPE_LEN bytes, the destination string str
was not terminated.

The patch adds one more byte to str and makes sure that this byte is
always 0.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Arnaud Patard <apatard@mandriva.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/2053/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-03-14 21:07:26 +01:00
..
cs5536 MIPS: Loongson: Migrate makefile to new Platform file 2010-08-05 13:25:45 +01:00
Makefile MIPS: Loongson: Define rtc device on MC146818-equipped systems 2010-07-05 17:17:32 +01:00
bonito-irq.c MIPS: Loongson: Add basic Loongson 2F support 2009-12-17 01:57:10 +00:00
cmdline.c MIPS: Loongson: Remove ad-hoc cmdline default 2011-03-14 21:07:25 +01:00
early_printk.c MIPS: Loongson: Change the Email address of Wu Zhangjin 2010-02-27 12:53:12 +01:00
env.c MIPS: Loongson: Add return value check for strict_strtoul() 2010-12-16 18:10:55 +00:00
gpio.c MIPS: Loongson 2F: Add gpio/gpioilb support 2010-05-21 21:31:16 +01:00
init.c MIPS: Loongson: Change the Email address of Wu Zhangjin 2010-02-27 12:53:12 +01:00
irq.c MIPS: Loongson: Remove set_irq_trigger_mode() 2010-08-05 13:26:23 +01:00
machtype.c MIPS: Loongson: Fix potentially wrong string handling 2011-03-14 21:07:26 +01:00
mem.c MIPS: Loongson: Fix phys_mem_access_prot() check 2010-04-30 20:52:51 +01:00
pci.c MIPS: Loongson 2F: Cleanup the #if clauses 2009-12-17 01:57:15 +00:00
platform.c MIPS: Loongson: Change the Email address of Wu Zhangjin 2010-02-27 12:53:12 +01:00
pm.c suspend: constify platform_suspend_ops 2010-11-16 14:14:02 +01:00
reset.c MIPS: Loongson 2F: Fix of problems introduced by -mfix-loongson2f-jump 2010-04-30 20:52:58 +01:00
rtc.c MIPS: Loongson: Define rtc device on MC146818-equipped systems 2010-07-05 17:17:32 +01:00
serial.c MIPS: Loongson: Change the Email address of Wu Zhangjin 2010-02-27 12:53:12 +01:00
setup.c MIPS: Fixup screen_info struct initializations 2010-04-30 20:52:42 +01:00
time.c MIPS: Loongson: Change the Email address of Wu Zhangjin 2010-02-27 12:53:12 +01:00
uart_base.c MIPS: Loongson: Change the Email address of Wu Zhangjin 2010-02-27 12:53:12 +01:00