Skip to content

Commit

Permalink
tools/usbip: fixes potential (minor) "buffer overflow" (detected on r…
Browse files Browse the repository at this point in the history
…ecent gcc with -Werror)

Fixes following build error:
vhci_driver.c: In function 'refresh_imported_device_list':
vhci_driver.c:118:37: error: 'snprintf' output may be truncated before
	the last format character [-Werror=format-truncation=]
    snprintf(status, sizeof(status), "status.%d", i);
                                     ^~~~~~~~~~~
vhci_driver.c:118:4: note: 'snprintf' output between 9 and 18 bytes into
	a destination of size 17
    snprintf(status, sizeof(status), "status.%d", i);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Julien BOIBESSOT <[email protected]>
Acked-by: Shuah Khan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Julien BOIBESSOT authored and gregkh committed Dec 8, 2017
1 parent 6235445 commit 82a2b82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/usb/usbip/libsrc/vhci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static int parse_status(const char *value)
return 0;
}

#define MAX_STATUS_NAME 16
#define MAX_STATUS_NAME 18

static int refresh_imported_device_list(void)
{
Expand Down

0 comments on commit 82a2b82

Please sign in to comment.