刘河 6 år sedan
förälder
incheckning
4a7a0a7b75
1 ändrade filer med 3 tillägg och 0 borttagningar
  1. 3 0
      server/proxy/https.go

+ 3 - 0
server/proxy/https.go

@@ -165,6 +165,9 @@ func GetServerNameFromClientHello(c net.Conn) (string, []byte) {
 	if err != nil {
 		return "", nil
 	}
+	if n < 42 {
+		return "", nil
+	}
 	copy(data, buf[:n])
 	clientHello := new(crypt.ClientHelloMsg)
 	clientHello.Unmarshal(data[5:n])