Skip to content

Commit

Permalink
add more check when hello is too small
Browse files Browse the repository at this point in the history
  • Loading branch information
jyyi1 committed Mar 18, 2024
1 parent 98abb82 commit da3f1f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Android/app/src/go/intra/split/retrier.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func splitHello(hello []byte, w io.Writer) (n int, splitLen int, err error) {

recordLen, ok := getTLSClientHelloRecordLen(hello)
recordSplitLen := splitLen - 5
if !ok || recordSplitLen >= int(recordLen) {
if !ok || recordSplitLen <= 0 || recordSplitLen >= int(recordLen) {
// Do TCP split if hello is not a valid TLS Client Hello, or cannot be fragmented
n, err = w.Write(hello[:splitLen])
if err == nil {
Expand Down

0 comments on commit da3f1f4

Please sign in to comment.