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


engines/e_4758cca.c:600:1: start of procedure cca_rsa_verify()
598.   #   define SSL_SIG_LEN 36
599.   
600. > static int cca_rsa_verify(int type, const unsigned char *m,
601.                             unsigned int m_len, const unsigned char *sigbuf,
602.                             unsigned int siglen, const RSA *rsa)

engines/e_4758cca.c:606:5: 
604.       long returnCode;
605.       long reasonCode;
606. >     long lsiglen = siglen;
607.       long exitDataLength = 0;
608.       unsigned char exitData[8];

engines/e_4758cca.c:607:5: 
605.       long reasonCode;
606.       long lsiglen = siglen;
607. >     long exitDataLength = 0;
608.       unsigned char exitData[8];
609.       long ruleArrayLength = 1;

engines/e_4758cca.c:609:5: 
607.       long exitDataLength = 0;
608.       unsigned char exitData[8];
609. >     long ruleArrayLength = 1;
610.       unsigned char ruleArray[8] = "PKCS-1.1";
611.       long keyTokenLength;

engines/e_4758cca.c:610:5: 
608.       unsigned char exitData[8];
609.       long ruleArrayLength = 1;
610. >     unsigned char ruleArray[8] = "PKCS-1.1";
611.       long keyTokenLength;
612.       unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);

engines/e_4758cca.c:612:5: 
610.       unsigned char ruleArray[8] = "PKCS-1.1";
611.       long keyTokenLength;
612. >     unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
613.       long length = SSL_SIG_LEN;
614.       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:613:5: 
611.       long keyTokenLength;
612.       unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
613. >     long length = SSL_SIG_LEN;
614.       long keyLength;
615.       unsigned char *hashBuffer = NULL;

engines/e_4758cca.c:615:5: 
613.       long length = SSL_SIG_LEN;
614.       long keyLength;
615. >     unsigned char *hashBuffer = NULL;
616.       X509_SIG sig;
617.       ASN1_TYPE parameter;

engines/e_4758cca.c:621:5: 
619.       ASN1_OCTET_STRING digest;
620.   
621. >     keyTokenLength = *(long *)keyToken;
622.       keyToken += sizeof(long);
623.   
