summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2016-12-10 14:13:41 +0100
committerPali Rohár <pali.rohar@gmail.com>2016-12-10 14:13:41 +0100
commit6ec64f4992ccd5e4ff42e9578d6c306a5b688a35 (patch)
tree2fbfade51cc4be2cc1b47f945b5177b5b9c401ca
parent8f57f7ef61fe2f439422d5dc313d2005d8adc370 (diff)
download0xFFFF-6ec64f4992ccd5e4ff42e9578d6c306a5b688a35.tar.bz2
operations: Fix NULL pointer dereference in dev_boot_device
This will fix a crash when calling "0xFFFF -b" from Mk II Update mode.
-rw-r--r--src/operations.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/operations.c b/src/operations.c
index 1fd4766..cd7ef44 100644
--- a/src/operations.c
+++ b/src/operations.c
@@ -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);