Skip to content

Commit

Permalink
fix(telnet): Fix panic if the index byte is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 19, 2024
1 parent bb7c16f commit 931bb31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/server/telnet/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func ScanIacSe(data []byte, atEOF bool) (int, []byte, error) {
if atEOF && len(data) == 0 {
return 0, nil, nil
}
if i := bytes.Index(data, []byte{byte(Iac), byte(Se)}); i != 0 {
if i := bytes.Index(data, []byte{byte(Iac), byte(Se)}); i > 0 {
// We have a full newline-terminated line.
return i + 2, trimIac(data[:i]), nil
}
Expand Down

0 comments on commit 931bb31

Please sign in to comment.