On 8/16/2013 1:51 PM, Ztatik Light wrote:
found yet another weird peculiarity...

In my full application, i need the following lines after both
encrypt_file() and decrypt_read(), otherwise i get garbage data:

char err[1024];
ERR_error_string( ERR_get_error(), err );
printf( "%s\n", err );

And err is 0... but without those three lines then i get garbage data
decrypted

And if i use a format string like ">%s\n" i also get garbage again. HAS
to be "%s\n". I have no idea wtf is up with all these bugs but i'm
surprised openssl is this glitchy

I would hesitate to blame openssl, used by 1000's of people for many years, while being so confident that your new code is bug free.

In particular, you observed that allocating an extra 1024 bytes on your stack fixes the problem. You also observed that the bug is sensitive to the number of bytes in an array.

I conclude that you're overwriting some variable on your stack.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to