engines/e_4758cca.c:732: error: NULL_DEREFERENCE
  pointer `keyToken` last assigned on line 724 could be null and is dereferenced at line 732, column 22.
Showing all 29 steps of the trace


engines/e_4758cca.c:710:1: start of procedure cca_rsa_sign()
708.   #   define SSL_SIG_LEN 36
709.   
710. > static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len,
711.                           unsigned char *sigret, unsigned int *siglen,
712.                           const RSA *rsa)

engines/e_4758cca.c:716:5: 
714.       long returnCode;
715.       long reasonCode;
716. >     long exitDataLength = 0;
717.       unsigned char exitData[8];
718.       long ruleArrayLength = 1;

engines/e_4758cca.c:718:5: 
716.       long exitDataLength = 0;
717.       unsigned char exitData[8];
718. >     long ruleArrayLength = 1;
719.       unsigned char ruleArray[8] = "PKCS-1.1";
720.       long outputLength = 256;

engines/e_4758cca.c:719:5: 
717.       unsigned char exitData[8];
718.       long ruleArrayLength = 1;
719. >     unsigned char ruleArray[8] = "PKCS-1.1";
720.       long outputLength = 256;
721.       long outputBitLength;

engines/e_4758cca.c:720:5: 
718.       long ruleArrayLength = 1;
719.       unsigned char ruleArray[8] = "PKCS-1.1";
720. >     long outputLength = 256;
721.       long outputBitLength;
722.       long keyTokenLength;

engines/e_4758cca.c:723:5: 
721.       long outputBitLength;
722.       long keyTokenLength;
723. >     unsigned char *hashBuffer = NULL;
724.       unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
725.       long length = SSL_SIG_LEN;

engines/e_4758cca.c:724:5: 
722.       long keyTokenLength;
723.       unsigned char *hashBuffer = NULL;
724. >     unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
725.       long length = SSL_SIG_LEN;
726.       long keyLength;

crypto/rsa/rsa_lib.c:265:1: start of procedure RSA_get_ex_data()
  263.   }
  264.   
  265. > void *RSA_get_ex_data(const RSA *r, int idx)
  266.   {
  267.       return (CRYPTO_get_ex_data(&r->ex_data, idx));

crypto/rsa/rsa_lib.c:267:5: 
  265.   void *RSA_get_ex_data(const RSA *r, int idx)
  266.   {
  267. >     return (CRYPTO_get_ex_data(&r->ex_data, idx));
  268.   }
  269.   

crypto/ex_data.c:398:1: start of procedure CRYPTO_get_ex_data()
    396.    * particular index in the class used by this variable
    397.    */
    398. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    399.   {
    400.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))

crypto/ex_data.c:400:9: Taking false branch
    398.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    399.   {
    400.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                   ^
    401.           return NULL;
    402.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:400:34: Condition is true
    398.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    399.   {
    400.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                                            ^
    401.           return NULL;
    402.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:400:27: 
    398.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    399.   {
    400. >     if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    401.           return NULL;
    402.       return sk_void_value(ad->sk, idx);

crypto/stack/stack.c:321:1: start of procedure sk_num()
      319.   }
      320.   
      321. > int sk_num(const _STACK *st)
      322.   {
      323.       if (st == NULL)

crypto/stack/stack.c:323:9: Taking false branch
      321.   int sk_num(const _STACK *st)
      322.   {
      323.       if (st == NULL)
                     ^
      324.           return -1;
      325.       return st->num;

crypto/stack/stack.c:325:5: 
      323.       if (st == NULL)
      324.           return -1;
      325. >     return st->num;
      326.   }
      327.   

crypto/stack/stack.c:326:1: return from a call to sk_num
      324.           return -1;
      325.       return st->num;
      326. > }
      327.   
      328.   void *sk_value(const _STACK *st, int i)

crypto/ex_data.c:400:27: Taking false branch
    398.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    399.   {
    400.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                                     ^
    401.           return NULL;
    402.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:402:12: Condition is true
    400.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    401.           return NULL;
    402.       return sk_void_value(ad->sk, idx);
                      ^
    403.   }

crypto/ex_data.c:402:5: 
    400.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    401.           return NULL;
    402. >     return sk_void_value(ad->sk, idx);
    403.   }

crypto/stack/stack.c:328:1: start of procedure sk_value()
      326.   }
      327.   
      328. > void *sk_value(const _STACK *st, int i)
      329.   {
      330.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:330:10: Taking false branch
      328.   void *sk_value(const _STACK *st, int i)
      329.   {
      330.       if (!st || (i < 0) || (i >= st->num))
                      ^
      331.           return NULL;
      332.       return st->data[i];

crypto/stack/stack.c:330:17: Taking true branch
      328.   void *sk_value(const _STACK *st, int i)
      329.   {
      330.       if (!st || (i < 0) || (i >= st->num))
                             ^
      331.           return NULL;
      332.       return st->data[i];

crypto/stack/stack.c:331:9: 
      329.   {
      330.       if (!st || (i < 0) || (i >= st->num))
      331. >         return NULL;
      332.       return st->data[i];
      333.   }

crypto/stack/stack.c:333:1: return from a call to sk_value
      331.           return NULL;
      332.       return st->data[i];
      333. > }
      334.   
      335.   void *sk_set(_STACK *st, int i, void *value)

crypto/ex_data.c:403:1: return from a call to CRYPTO_get_ex_data
    401.           return NULL;
    402.       return sk_void_value(ad->sk, idx);
    403. > }

crypto/rsa/rsa_lib.c:268:1: return from a call to RSA_get_ex_data
  266.   {
  267.       return (CRYPTO_get_ex_data(&r->ex_data, idx));
  268. > }
  269.   
  270.   int RSA_memory_lock(RSA *r)

engines/e_4758cca.c:725:5: 
723.       unsigned char *hashBuffer = NULL;
724.       unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
725. >     long length = SSL_SIG_LEN;
726.       long keyLength;
727.       X509_SIG sig;

engines/e_4758cca.c:732:5: 
730.       ASN1_OCTET_STRING digest;
731.   
732. >     keyTokenLength = *(long *)keyToken;
733.       keyToken += sizeof(long);
734.   
