From 6adbd4e787c3dab52c8bf7f0042c120bbfb15b8b Mon Sep 17 00:00:00 2001 From: Pavlin Radoslavov Date: Wed, 25 Jan 2017 19:07:46 -0800 Subject: [PATCH] Fix a crash when parsing fastboot command-line arguments Fix a crash when running "fastboot reboot bootloader" Test: Manual run "fastboot reboot bootloader" and "fastboot reboot emergency" Change-Id: I6d163a5b640afcae1dfa606f409e23ec5f499184 --- fastboot/fastboot.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index f970e683b..e7f1a0721 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -1648,8 +1648,7 @@ int main(int argc, char **argv) wants_reboot = false; wants_reboot_bootloader = true; skip(1); - } - if (!strcmp(*argv, "emergency")) { + } else if (!strcmp(*argv, "emergency")) { wants_reboot = false; wants_reboot_emergency = true; skip(1);