aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2013-10-17 08:00:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-29 11:11:51 -0800
commita2db1eb6794f761bc90ae128c0694874bf572579 (patch)
treeed363b612b87b233ab6eadd5fd9b2b69036ebd00 /arch/powerpc
parentae4c6cbd0a56bcea14bf35168076b9ad5bd3203f (diff)
downloadlinaro-lsk-a2db1eb6794f761bc90ae128c0694874bf572579.tar.gz
powerpc/vio: use strcpy in modalias_show
commit 411cabf79e684171669ad29a0628c400b4431e95 upstream. Commit e82b89a6f19bae73fb064d1b3dd91fcefbb478f4 used strcat instead of strcpy which can result in an overflow of newlines on the buffer. Signed-off-by: Prarit Bhargava Cc: benh@kernel.crashing.org Cc: ben@decadent.org.uk Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/vio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 2d845d8199f..56d2e72c85d 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1530,12 +1530,12 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
dn = dev->of_node;
if (!dn) {
- strcat(buf, "\n");
+ strcpy(buf, "\n");
return strlen(buf);
}
cp = of_get_property(dn, "compatible", NULL);
if (!cp) {
- strcat(buf, "\n");
+ strcpy(buf, "\n");
return strlen(buf);
}