test(session): add unit tests for session behavior

This commit is contained in:
2026-01-23 19:03:01 +07:00
parent 21179da4b5
commit 14abac6579
2 changed files with 1446 additions and 2 deletions
+4 -2
View File
@@ -412,8 +412,10 @@ func readSSHString(reader io.Reader) (string, error) {
return "", err
}
strBytes := make([]byte, length)
if _, err := reader.Read(strBytes); err != nil {
return "", err
if length > 0 {
if _, err := io.ReadFull(reader, strBytes); err != nil {
return "", err
}
}
return string(strBytes), nil
}