Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1...
by throwaway2037 on Friday November 20, 2026 @05:54AM
(#50572937)
I have always been told it is a bad idea to use unsigned integers in your interfaces. Why? An accidental negative (signed) value will be cast into an enormous unsigned value. For example, if you look at the vast majority of the Win32 API, inputs are normally signed integers. They rarely use unsigned integers.
[ Parent
| on HN ]
Re:OpenSSL: Buffer overflow in EVP_EncodeBlock() (CVE-2026-1...
by Panzerschrek on Friday November 20, 2026 @11:02AM
(#50576772)
> An accidental negative (signed) value will
If you use mostly unsigned values it's not a huge problem, as long as you don't perform subtractions or operations with possibility of overflow. If obtaining a negative value or getting an overflow may occur, you should perform proper checks before calling an API function. And in case of WinAPI or something similar usually no extra computations before a call are necessary, arguments are already precomputed (like with buffer sizes).