summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ryan Prichard <rprichard@google.com> 2025-02-10 20:54:36 -0800
committer Ryan Prichard <rprichard@google.com> 2025-02-11 12:12:59 -0800
commit6990f50c756c47a38a42edb3462e28aa67dafac2 (patch)
tree9c31d121b7ac20c69624329e0732b64c427c0753
parent9dd0dc2b8997caa4abce1923177ff3951a237883 (diff)
FindProtoId: avoid UB on empty signature_type_idxs
Bug: http://b/395138850 Test: m art_standalone_libdexfile_tests && \ adb root && adb sync data && \ adb shell /data/nativetest64/art_standalone_libdexfile_tests/art_standalone_libdexfile_tests64 --gtest_filter='*FindProtoId*' --no_isolate Change-Id: Ie3e27c4d2e18b152f1a7a5123422d71422cbcc37
-rw-r--r--libdexfile/dex/dex_file.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdexfile/dex/dex_file.h b/libdexfile/dex/dex_file.h
index 619ee0d4f5..7cf0b7f62c 100644
--- a/libdexfile/dex/dex_file.h
+++ b/libdexfile/dex/dex_file.h
@@ -591,7 +591,7 @@ class DexFile {
uint32_t signature_length) const;
const dex::ProtoId* FindProtoId(dex::TypeIndex return_type_idx,
const std::vector<dex::TypeIndex>& signature_type_idxs) const {
- return FindProtoId(return_type_idx, &signature_type_idxs[0], signature_type_idxs.size());
+ return FindProtoId(return_type_idx, signature_type_idxs.data(), signature_type_idxs.size());
}
// Given a signature place the type ids into the given vector, returns true on success