operations: Fix NULL pointer dereference in dev_boot_device

This will fix a crash when calling "0xFFFF -b" from Mk II Update mode.
This commit is contained in:
Pali Rohár committed 2016-12-10 14:13:41 +01:00
1 parent 8f57f7ef61
commit 6ec64f4992
1 file changed
+1 -1
+1 -1
View File
@@ -243,7 +243,7 @@ int dev_boot_device(struct device_info * dev, const char * cmdline) {
if ( protocol == FLASH_NOLO )
return nolo_boot_device(dev->usb, cmdline);
else if ( protocol == FLASH_MKII && strcmp(cmdline, "update") == 0 )
else if ( protocol == FLASH_MKII && cmdline && strcmp(cmdline, "update") == 0 )
return mkii_reboot_device(dev->usb, 1);
usb_switch_to_nolo(dev->usb);