linux/arch/mips/loongson
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
..
common MIPS: Loongson: Fix potentially wrong string handling 2011-03-14 21:07:26 +01:00
fuloong-2e MIPS: Loongson: Oprofile: add a new do_perfcnt_IRQ() 2010-08-05 13:26:24 +01:00
lemote-2f MIPS: Loongson: Remove unused macro LOONGSON_PERFCNT_IRQ 2010-08-05 13:26:26 +01:00
Kconfig MIPS: Kconfig cleanup 2010-10-29 19:08:26 +01:00
Makefile MIPS: Lemote 2F: Add IRQ support 2009-12-17 01:57:13 +00:00
Platform MIPS: Loongson: Migrate makefile to new Platform file 2010-08-05 13:25:45 +01:00