aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2022-11-26 13:57:53 +0100
committerMarek Vasut <marex@denx.de>2022-11-27 12:04:36 +0100
commit55a95f8f58cf5c884edfe8714bf681cd17ef7242 (patch)
treefad6e70fb1c7891af9911540f36c6811d52c29ba /drivers
parent27c415ae8b743710e412ef408b52894af68141c6 (diff)
downloadu-boot-55a95f8f58cf5c884edfe8714bf681cd17ef7242.zip
u-boot-55a95f8f58cf5c884edfe8714bf681cd17ef7242.tar.gz
u-boot-55a95f8f58cf5c884edfe8714bf681cd17ef7242.tar.bz2
usb: Expand buffer size in usb_find_and_bind_driver()
The "generic_bus_%x_dev_%x" string which is printed into this buffer can be up to 34 characters long ("generic_bus_12345678_dev_12345678"). The buffer would be clipped by snprintf() if both %x were at maximum range. Make sure the buffer is long enough to cover such possibility. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/usb-uclass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 27e2fc6..060f344 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -557,7 +557,7 @@ static int usb_find_and_bind_driver(struct udevice *parent,
struct usb_driver_entry *start, *entry;
int n_ents;
int ret;
- char name[30], *str;
+ char name[34], *str;
ofnode node = usb_get_ofnode(parent, port);
*devp = NULL;