Skip to content

Commit ff53a75

Browse files
committed
prevents an overflowing subtraction when using JLink
1 parent d336c21 commit ff53a75

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
@@ -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
}

0 commit comments

Comments
 (0)