Skip to content

Commit dbe7e09

Browse files
eldadparoj
authored andcommitted
xbox 360: fix null pointer dereference when manufacturer is null
This occurs with MSI GC20 on Ubuntu 22.04.1 LTS. Signed-off-by: Eldad Zack <[email protected]>
1 parent 0270e37 commit dbe7e09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xpad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ static int xpad_start_xbox_360(struct usb_xpad *xpad)
15611561
have to inspect the manufacturer string.
15621562
Sending this sequence to other controllers will break initialization.
15631563
*/
1564-
bool is_shanwan = strcasecmp("shanwan", xpad->udev->manufacturer) == 0;
1564+
bool is_shanwan = xpad->udev->manufacturer && strcasecmp("shanwan", xpad->udev->manufacturer) == 0;
15651565
if (!(xpad->quirks & QUIRK_360_START) && !is_shanwan) {
15661566
status = 0;
15671567
goto err_free_ctrl_data;

0 commit comments

Comments
 (0)