Skip to content

Commit 62ad48a

Browse files
committed
return error instead of panicking
1 parent 3d4b6e7 commit 62ad48a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/binary/load_kernel.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,9 @@ where
344344
} else {
345345
// The section doesn't contain any relocations.
346346

347-
assert_eq!(rela_size, None);
348-
assert_eq!(rela_ent, None);
347+
if rela_size.is_some() || rela_ent.is_some() {
348+
return Err("Rela entry is missing but RelaSize or RelaEnt have been provided");
349+
}
349350

350351
return Ok(());
351352
};

0 commit comments

Comments
 (0)