diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-10-09 23:21:54 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-10-09 23:21:54 +0000 |
commit | 9810709d916cf0cc8b462e28dc43dc053dbb0ef5 (patch) | |
tree | 87912afb6337924d1239ebd750b10d0ade6bd9ca | |
parent | b2263b4a075f93cc487c6e7e7cfc6e33afdf6ff9 (diff) | |
parent | 4165e00d67f90136733bf90b3e21b9bc091f03c2 (diff) | |
download | system_core-9810709d916cf0cc8b462e28dc43dc053dbb0ef5.tar.gz system_core-9810709d916cf0cc8b462e28dc43dc053dbb0ef5.tar.bz2 system_core-9810709d916cf0cc8b462e28dc43dc053dbb0ef5.zip |
Merge "Check validity of partition for getvar:partition-type"
-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"; |