diff options
Diffstat (limited to 'fastboot/device')
-rw-r--r-- | fastboot/device/variables.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fastboot/device/variables.cpp b/fastboot/device/variables.cpp index c8756aedb..cbd2856dc 100644 --- a/fastboot/device/variables.cpp +++ b/fastboot/device/variables.cpp @@ -308,7 +308,14 @@ bool GetPartitionType(FastbootDevice* device, const std::vector<std::string>& ar *message = "Missing argument"; return false; } + std::string partition_name = args[0]; + if (!FindPhysicalPartition(partition_name) && + !LogicalPartitionExists(partition_name, device->GetCurrentSlot())) { + *message = "Invalid partition"; + return false; + } + auto fastboot_hal = device->fastboot_hal(); if (!fastboot_hal) { *message = "Fastboot HAL not found"; |