summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2777789)
raw | patch | inline | side by side (parent: 2777789)
author | Chen Gang <gang.chen@asianux.com> | |
Mon, 25 Feb 2013 16:51:49 +0000 (16:51 +0000) | ||
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | |
Tue, 5 Mar 2013 05:56:27 +0000 (16:56 +1100) |
the dest buf len is 80 (HVCS_CLC_LENGTH + 1).
the src buf len is PAGE_SIZE.
if src buf string len is more than 80, it will cause issue.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
the src buf len is PAGE_SIZE.
if src buf string len is more than 80, it will cause issue.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/pseries/hvcserver.c | patch | blob | history |
diff --git a/arch/powerpc/platforms/pseries/hvcserver.c b/arch/powerpc/platforms/pseries/hvcserver.c
index fcf4b4cbeaf331aa7986b0b705bc4bbe2148ee7b..4557e91626c43bd58d95a1730456557eab3aee2f 100644 (file)
#include <linux/list.h>
#include <linux/module.h>
#include <linux/slab.h>
+#include <linux/string.h>
#include <asm/hvcall.h>
#include <asm/hvcserver.h>
= (unsigned int)last_p_partition_ID;
/* copy the Null-term char too */
- strncpy(&next_partner_info->location_code[0],
+ strlcpy(&next_partner_info->location_code[0],
(char *)&pi_buff[2],
- strlen((char *)&pi_buff[2]) + 1);
+ sizeof(next_partner_info->location_code));
list_add_tail(&(next_partner_info->node), head);
next_partner_info = NULL;