Skip to content

Commit fb0b872

Browse files
committed
prevents an overflowing subtraction when using JLink
1 parent f1111c8 commit fb0b872

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

humility-core/src/core.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,9 @@ impl GDBCore {
851851
// We are done when we have our closing delimter followed by
852852
// the two byte checksum.
853853
//
854-
if result.find(GDB_PACKET_END) == Some(result.len() - 3) {
854+
if result.len() >= 3
855+
&& result.find(GDB_PACKET_END) == Some(result.len() - 3)
856+
{
855857
break;
856858
}
857859
}

humility-core/src/hubris.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,8 @@ impl HubrisArchive {
678678
let file = match header.file(file) {
679679
Some(header) => header,
680680
None => {
681-
bail!("no header at {}", goff);
681+
//bail!("no header at {}", goff);
682+
return Ok(());
682683
}
683684
};
684685

0 commit comments

Comments
 (0)