Skip to content
Snippets Groups Projects
Commit 77ed7a2a authored by Yuichiro Goto's avatar Yuichiro Goto Committed by Tom Rini
Browse files

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: 694cd561 ("IOMUX: Introduce iomux_replace_device()")
Signed-off-by: default avatarYuichiro 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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarPeter Robinson <pbrobinson@gmail.com>
parent 230bc623
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment