Note that there are some explanatory texts on larger screens.

plurals
  1. POPointer corruption when passed from a different file Fedora 17
    primarykey
    data
    text
    <p>Has anyone come across this issue of pointer getting corrupted in Fedora Core 17 64bit </p> <pre><code>Linux (none) 3.3.4-5.fc17.x86_64 #1 </code></pre> <p>gcc <code>gcc (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)</code></p> <p>For instance I have files A.c containing function aaa() returning or accepting some pointer and B.c has a function bbb() returning or accepting some pointer. In my scenario I am passing a context pointer from bbb() to aaa() and here is what i pass</p> <pre><code>values e n d 0x2b440c0 0x2b4a190 0x2b57db0 </code></pre> <p>and here is what I receive in function aaa()</p> <pre><code>values e n d 0x2b440c000000000 0x2b57db000000000 0x0 </code></pre> <p>I am not running any compiler optimization flags on this. Although if I maintain both the functions in one file, things work properly as expected.</p> <p>Have added some code here that might help</p> <pre><code>file: src/enc/encrypt.c function PopulateEncryptionKeys dataEncrypt-&gt;stRsa = RSA_new(); ---&gt; this is ok 0x21d0440 if(dataEncrypt-&gt;stRsa == NULL) { return FALSE; } dataEncrypt-&gt;stRsa-&gt;e = BN_bin2bn("&lt;hex data&gt;", 1, dataEncrypt-&gt;stRsa-&gt;e); dataEncrypt-&gt;stRsa-&gt;n = BN_bin2bn(dataEncrypt-&gt;m_nPublicKey, val, dataEncrypt-&gt;stRsa-&gt;n); dataEncrypt-&gt;stRsa-&gt;d = BN_bin2bn(dataEncrypt-&gt;m_nPrivateExponent, val, dataEncrypt-&gt;stRsa-&gt;d); ----&gt; these are ok RSA_blinding_off(dataEncrypt-&gt;stRsa); file: src/enc/encrypt.c function: Decipher keyRetVal = RSAPrivateDecrypt(nDecryptedMessage,nDataBuffer,m_dataEncryption-&gt;stRsa,val,var); Uptill this the values of e n and d above are values e n d 0x2364090 0x23640d0 0x23a2c10 This function calls another function part of crypto wraper, which inturn is supposed to to call BN_bn2bin file: src/crypto/wrapper.c function: RSAPrivateDecrypt int RSAPrivateDecrypt(unsigned char *decryptedBuffer,unsigned char *data, RSA* rsa, int flen, int reverseKeyData) RSAPrivateDecrypt: rsa is 0x20cc440 e n d 0x229ec1000000000 0x226009000000000 (nil) </code></pre> <p>Any thoughts on this?</p> <p>Appreciate, Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload