mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 15:12:59 +02:00
powerpc/vio: use strcpy in modalias_show
commit411cabf79eupstream. Commite82b89a6f1used 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>
This commit is contained in:
parent
ae4c6cbd0a
commit
a2db1eb679
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user