Skip to content

Commit ed12148

Browse files
committed
prevents an overflowing subtraction when using JLink
1 parent 22c2b83 commit ed12148

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

humility-core/src/core.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@ impl GDBCore {
593593
// We are done when we have our closing delimter followed by
594594
// the two byte checksum.
595595
//
596-
if result.find(GDB_PACKET_END) == Some(result.len() - 3) {
596+
if result.len() >= 3
597+
&& result.find(GDB_PACKET_END) == Some(result.len() - 3)
598+
{
597599
break;
598600
}
599601
}

0 commit comments

Comments
 (0)