Skip to content

Commit 70cd057

Browse files
andy-shevgregkh
authored andcommitted
usb: hcd: Bump local buffer size in rh_string()
GCC is not happy about the buffer size: drivers/usb/core/hcd.c:441:48: error: ‘%s’ directive output may be truncated writing up to 64 bytes into a region of size between 35 and 99 [-Werror=format-truncation=] 441 | snprintf (buf, sizeof buf, "%s %s %s", init_utsname()->sysname, | ^~ 442 | init_utsname()->release, hcd->driver->description); | ~~~~~~~~~~~~~~~~~~~~~~~ Bump the size to get it enough for the possible strings. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 086fd06 commit 70cd057

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/core/hcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ ascii2desc(char const *s, u8 *buf, unsigned len)
415415
static unsigned
416416
rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len)
417417
{
418-
char buf[100];
418+
char buf[160];
419419
char const *s;
420420
static char const langids[4] = {4, USB_DT_STRING, 0x09, 0x04};
421421

0 commit comments

Comments
 (0)