This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tls: remove harmful unnecessary bounds checking
The EncIn, EncOut, ClearIn & ClearOut functions are victims of some code copy + pasting. A common line copied to all of them is: `if (off >= buffer_length) { ...` 448e0f4 corrected ClearIn's check from `>=` to `>`, but left the others unchanged (with an incorrect bounds check). However, if you look down at the next very next bounds check you'll see: `if (off + len > buffer_length) { ...` So the check is actually obviated by the next line, and should be removed. This fixes an issue where writing a zero-length buffer to an encrypted pair's *encrypted* stream you would get a crash.
- Loading branch information