Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1...
by zzril on Friday November 20, 2026 @05:04AM
(#50572521)
That part of the API seems particularly random indeed, especially when comparing it to other EVP_{En,De}code* functions which use the returned int for success/error.
The only reason for such a design I could think of is that the caller would be able to "detect" the overflow by comparing the returned value against the length of the buffer. But that is of course pointless, as the compiler is free to assume a buffer overflow cannot happen and thus optimize the check away...
(Honest questions in this it’s probably been 20 years since I did c)