From 84333eb2dc7b4f10a6a0680956bac35a6cf1aaf5 Mon Sep 17 00:00:00 2001 From: Alex Hong Date: Mon, 9 Jan 2023 21:34:54 +0800 Subject: [PATCH] Fix the index out of bounds error when the modem FD is missing Bug: 263783650 Test: atest VtsHalDumpstateTargetTest pass Change-Id: If21800c40a5424d70e10e6dd027cee6737e46863 --- dumpstate/Dumpstate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dumpstate/Dumpstate.cpp b/dumpstate/Dumpstate.cpp index c06e448c..c7290de8 100644 --- a/dumpstate/Dumpstate.cpp +++ b/dumpstate/Dumpstate.cpp @@ -788,7 +788,7 @@ ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFile "Invalid mode"); } - if (in_fds.size() < 1) { + if (in_fds.size() < 2) { ALOGE("no FD for dumpstate_board binary\n"); } else { int fd_bin = in_fds[1].get();