From 4da610c22f179091d4555cec2791329c8f37dfa6 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Sun, 1 Dec 2024 18:05:18 +0100 Subject: [PATCH] Fix crash in StrictSubstr on `-ohos` artifacts Fixes a "region out-of-bounds" assertion failure in StrictSubstr. When `remaining_` is just the "\0" character we are done and should return. --- src/elf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elf.cc b/src/elf.cc index 59f10e1..e02173a 100644 --- a/src/elf.cc +++ b/src/elf.cc @@ -417,7 +417,7 @@ void ElfFile::Section::ReadRelocationWithAddend(Elf64_Word index, } void ElfFile::NoteIter::Next() { - if (remaining_.empty()) { + if (remaining_.empty() || remaining_.compare("\0")) { done_ = true; return; }