]> Git Repo - linux.git/commitdiff
usb: hcd: Bump local buffer size in rh_string()
authorAndy Shevchenko <[email protected]>
Thu, 16 Jan 2025 16:05:43 +0000 (18:05 +0200)
committerGreg Kroah-Hartman <[email protected]>
Fri, 17 Jan 2025 14:26:33 +0000 (15:26 +0100)
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]>
drivers/usb/core/hcd.c

index 0b2490347b9fe7b5d9b1be03d862058a47a937a0..a75cf1f6d741cf5827b9c4deca3b63013aff6cfe 100644 (file)
@@ -415,7 +415,7 @@ ascii2desc(char const *s, u8 *buf, unsigned len)
 static unsigned
 rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len)
 {
-       char buf[100];
+       char buf[160];
        char const *s;
        static char const langids[4] = {4, USB_DT_STRING, 0x09, 0x04};
 
This page took 0.089385 seconds and 4 git commands to generate.