diff --git a/humility-core/src/core.rs b/humility-core/src/core.rs index 9a1f8f77e..48bb6c6d0 100644 --- a/humility-core/src/core.rs +++ b/humility-core/src/core.rs @@ -851,7 +851,9 @@ impl GDBCore { // We are done when we have our closing delimter followed by // the two byte checksum. // - if result.find(GDB_PACKET_END) == Some(result.len() - 3) { + if result.len() >= 3 + && result.find(GDB_PACKET_END) == Some(result.len() - 3) + { break; } }