mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 15:58:43 +00:00
Fix validation logic in TvInputAidlTest
[Description]
Handle validation incorrectly allows empty integer arrays, causing
potential errors.
Bug:348575546
[Test Report]
Test ok
Change-Id: Ie597fecfaa783b050510b11665a03e31ccb8feaf
(cherry picked from commit 3b85a4e59a)
This commit is contained in:
@@ -135,13 +135,15 @@ int32_t TvInputAidlTest::getNumNotIn(vector<int32_t>& nums) {
|
||||
}
|
||||
|
||||
bool TvInputAidlTest::isValidHandle(NativeHandle& handle) {
|
||||
if (handle.fds.empty()) {
|
||||
if (handle.fds.empty() && handle.ints.empty()) {
|
||||
return false;
|
||||
}
|
||||
for (size_t i = 0; i < handle.fds.size(); i++) {
|
||||
int fd = handle.fds[i].get();
|
||||
if (fcntl(fd, F_GETFL) < 0) {
|
||||
return false;
|
||||
if (!(handle.fds.empty())) {
|
||||
for (size_t i = 0; i < handle.fds.size(); i++) {
|
||||
int fd = handle.fds[i].get();
|
||||
if (fcntl(fd, F_GETFL) < 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user