Ensure free buffer space when reading TLS messages (#83480)
authorRadek Zikmund <32671551+rzikm@users.noreply.github.com>
Fri, 17 Mar 2023 08:17:18 +0000 (09:17 +0100)
committerGitHub <noreply@github.com>
Fri, 17 Mar 2023 08:17:18 +0000 (09:17 +0100)
commit673afec8a76cb4437eba318d7132140b7da9b111
treea72e56e88de641ba505f96aa0d511f7e94737d9a
parentb90c9cf68b8849a1090f64186033ac99d234c8c2
Ensure free buffer space when reading TLS messages (#83480)

* Ensure free buffer space when reading TLS messages

* Move buffer expansion outside of the loop to prevent unbounded grow

* Fix failing tests

The initial size is not enough to cover later TLS frames
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs