ARM: omap2+: fixing wrong strcat for Non-NULL terminated string
authorManinder Singh <maninder1.s@samsung.com>
Thu, 8 Dec 2016 04:10:30 +0000 (09:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Aug 2017 01:59:44 +0000 (18:59 -0700)
commit0686a9bc42adff7e70f345685a059ccd2de6f42d
treec866c106bb090382179a0be2113a22e6ac524c69
parent82338e9ffba55e611613f6a5dfd17697fd76e1e2
ARM: omap2+: fixing wrong strcat for Non-NULL terminated string

[ Upstream commit 5066d5296ff2db20625e5f46e7338872c90c649f ]

Issue caught with static analysis tool:
"Dangerous usage of 'name' (strncpy doesn't always 0-terminate it)"

Use strlcpy _includes_ the NUL terminator, and  strlcat() which ensures
that it won't overflow the buffer.

Reported-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Vaneet Narang <v.narang@samsung.com>
CC: Russell King <linux@armlinux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-omap2/omap_hwmod.c