From e27f6ac3fd402dde44eec494f58322604a96e644 Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Tue, 13 Feb 2024 13:40:31 +0000 Subject: [PATCH] Fix out of bounds vector access --- src/ccc/elf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ccc/elf.cpp b/src/ccc/elf.cpp index 9306f19..bd5e789 100644 --- a/src/ccc/elf.cpp +++ b/src/ccc/elf.cpp @@ -106,7 +106,7 @@ Result> ElfFile::get_virtual(u32 address, u32 size) const size_t begin_offset = segment.offset + (address - segment.address.value); size_t end_offset = begin_offset + size; if(end_offset <= image.size()) { - return std::span(&image[begin_offset], &image[end_offset]); + return std::span(image.data() + begin_offset, image.data() + end_offset); } } }