mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
powerpc/vio: use strcpy in modalias_show
Commit e82b89a6f1
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
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
ecb35c3943
commit
411cabf79e
1 changed files with 2 additions and 2 deletions
|
@ -1531,12 +1531,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 a new issue