Sorry, I don't think that breaks any const rules.
See explanation and example in ISO/IEC 14882 section 7.1.5.1.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2008 3:59 PM
To: [email protected]
Subject: memory corruption after usin BN_mod_inverse


Hello!

During the OpenSSL source investigation I found some strange call in
function BN_mod_inverse:
...
if (sign < 0)
    {
        if (!BN_sub(Y,n,Y)) goto err;
    }
...

But! Declaration of BN_sub looks like this:
int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)

In some circumstances r will be expanded in BN_sub, so original call
"BN_sub(Y,n,Y)" breaks the rule of const.

--
 Eugene.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

This email and any files transmitted with it are confidential material. They 
are intended solely for the use of the designated individual or entity to whom 
they are addressed. If the reader of this message is not the intended 
recipient, you are hereby notified that any dissemination, use, distribution or 
copying of this communication is strictly prohibited and may be unlawful.

If you have received this email in error please immediately notify the sender 
and delete or destroy any copy of this message
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to