commit | 642dbc7b334310ea924cff205dba0d52b6a01448 | [log] [tgz] |
---|---|---|
author | Kelvin Zhang <zhangkelvin@google.com> | Wed Nov 08 00:34:33 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Nov 08 00:34:33 2023 +0000 |
tree | 75cf0da5a4561bead1bb04a48bd9ced9d1c9ecdd | |
parent | 42526f79371e7cae56afee8031da81de0f2e06d4 [diff] | |
parent | 1815c4dd52af47cf4783b4b3ee01fc67ecd04fd0 [diff] |
Add error check for GetCurrentSlot am: 1815c4dd52 Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/2820039 Change-Id: If038a57df61a15ab6bf6672b2ea504792ec03745 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/aosp/update_attempter_android.cc b/aosp/update_attempter_android.cc index d7cb2d2..ea83d9a 100644 --- a/aosp/update_attempter_android.cc +++ b/aosp/update_attempter_android.cc
@@ -638,6 +638,14 @@ ErrorCode errorcode{}; BootControlInterface::Slot current_slot = GetCurrentSlot(); + if (current_slot < 0) { + return LogAndSetError( + error, + __LINE__, + __FILE__, + "Failed to get current slot " + std::to_string(current_slot), + ErrorCode::kDownloadStateInitializationError); + } for (const PartitionUpdate& partition : manifest.partitions()) { if (!partition.has_old_partition_info()) continue;