> EVP_EncodeBlock() encodes a full block of input data in f and of length dlen and stores it in t. For every 3 bytes of input provided 4 bytes of output data will be produced. If dlen is not divisible by 3 then the block is encoded as a final block of data and the output is padded such that it is always divisible by 4. Additionally a NUL terminator character will be added. For example if 16 bytes of input data is provided then 24 bytes of encoded data is created plus 1 byte for a NUL terminator (i.e. 25 bytes in total). The length of the data generated without the NUL terminator is returned from the function.
My god, you only see this type of horrendous API in C don't you.
What's "horrendous"? I don't see anything which stands out as being wrong. It specifies exactly the lengths of input and output.
gets(), on the other hand, that is "horrendous".
"No way to prevent this" say users of only language where this regularly happens
https://xeiaso.net/blog/series/no-way-to-prevent-this/