mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
IOMUX: Fix buffer overflow in iomux_replace_device()
Use of strcat() against an uninitialized buffer would lead
to buffer overflow. This patch fixes it.
Fixes: 694cd5618c
("IOMUX: Introduce iomux_replace_device()")
Signed-off-by: Yuichiro Goto <goto@k-tech.co.jp>
Cc: Peter Robinson <pbrobinson@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
This commit is contained in:
parent
48594c38ed
commit
b104caa9a4
1 changed files with 6 additions and 2 deletions
|
@ -158,8 +158,12 @@ int iomux_replace_device(const int console, const char *old, const char *new)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
strcat(tmp, ",");
|
||||
strcat(tmp, name);
|
||||
if (arg) {
|
||||
strcat(tmp, ",");
|
||||
strcat(tmp, name);
|
||||
}
|
||||
else
|
||||
strcpy(tmp, name);
|
||||
|
||||
arg = tmp;
|
||||
size = strlen(tmp) + 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue