NAS: Fix out of bounds slice in TLS read
Some checks are pending
Build CI / build (push) Waiting to run
golangci-lint / lint (push) Waiting to run

This commit is contained in:
Palapeli
2026-04-10 10:52:14 -04:00
parent 70bec8f241
commit fdfa5ea352

View File

@@ -424,7 +424,7 @@ func (c *consoleTLSConn) Read(b []byte) (n int, err error) {
return 0, errors.New("non-application data received")
}
// Write the decrypted content to the buffer
if int(recordLength-5-16) > len(b) {
if int(recordLength-16) > len(b) {
c.decodedBuffer.Write(buf[5+len(b) : 5+recordLength-16])
}
c.encodedBuffer.Next(5 + int(recordLength))