process: fix panic on single item chains

This commit is contained in:
2025-12-04 05:59:35 +00:00
parent a22c9cd0ce
commit 3c26590c7c
+3
View File
@@ -104,6 +104,9 @@ impl Process {
if chain.is_empty() { if chain.is_empty() {
return Err(Error::ResolvePointerChainError("chain was empty".into())); return Err(Error::ResolvePointerChainError("chain was empty".into()));
} }
if chain.len() == 1 {
return Ok(chain[0]);
}
let mut address = chain[0]; let mut address = chain[0];
for &offset in &chain[1..(chain.len() - 1)] { for &offset in &chain[1..(chain.len() - 1)] {
address += offset; address += offset;