Skip to content

Commit

Permalink
xbox 360: fix null pointer dereference when manufacturer is null
Browse files Browse the repository at this point in the history
This occurs with MSI GC20 on Ubuntu 22.04.1 LTS.

Signed-off-by: Eldad Zack <[email protected]>
  • Loading branch information
eldad authored and paroj committed Oct 25, 2022
1 parent 0270e37 commit dbe7e09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ static int xpad_start_xbox_360(struct usb_xpad *xpad)
have to inspect the manufacturer string.
Sending this sequence to other controllers will break initialization.
*/
bool is_shanwan = strcasecmp("shanwan", xpad->udev->manufacturer) == 0;
bool is_shanwan = xpad->udev->manufacturer && strcasecmp("shanwan", xpad->udev->manufacturer) == 0;
if (!(xpad->quirks & QUIRK_360_START) && !is_shanwan) {
status = 0;
goto err_free_ctrl_data;
Expand Down

0 comments on commit dbe7e09

Please sign in to comment.