Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent potential out of bounds write on Android SslStream
This PR makes sure we never write more bytes into the destination buffer than we allocated. The way we currently use this function always is safe because we ensure that the destination buffer is large enough beforehand but it could be a problem if we reused this function somewhere else in the future. If there's too much data in the input buffer to fit into the destination buffer we read only as much as we can and we leave the rest of the data intact for future reads.
- Loading branch information