engines/e_4758_cca.c:626: error: NULL_DEREFERENCE
  pointer `keyToken` last assigned on line 617 could be null and is dereferenced at line 626, column 19.
Showing all 22 steps of the trace


engines/e_4758_cca.c:606:1: start of procedure cca_rsa_verify()
604.   #define SSL_SIG_LEN 36
605.   
606. > static int cca_rsa_verify(int type, const unsigned char *m, unsigned int m_len,
607.   		unsigned char *sigbuf, unsigned int siglen, const RSA *rsa)
608.   	{

engines/e_4758_cca.c:611:2: 
609.   	long returnCode;
610.   	long reasonCode;
611. > 	long lsiglen = siglen;
612.   	long exitDataLength = 0;
613.   	unsigned char exitData[8];

engines/e_4758_cca.c:612:2: 
610.   	long reasonCode;
611.   	long lsiglen = siglen;
612. > 	long exitDataLength = 0;
613.   	unsigned char exitData[8];
614.   	long ruleArrayLength = 1;

engines/e_4758_cca.c:614:2: 
612.   	long exitDataLength = 0;
613.   	unsigned char exitData[8];
614. > 	long ruleArrayLength = 1;
615.   	unsigned char ruleArray[8] = "PKCS-1.1";
616.   	long keyTokenLength;

engines/e_4758_cca.c:615:2: 
613.   	unsigned char exitData[8];
614.   	long ruleArrayLength = 1;
615. > 	unsigned char ruleArray[8] = "PKCS-1.1";
616.   	long keyTokenLength;
617.   	unsigned char* keyToken = (unsigned char*)RSA_get_ex_data(rsa, hndidx);

engines/e_4758_cca.c:617:2: 
615.   	unsigned char ruleArray[8] = "PKCS-1.1";
616.   	long keyTokenLength;
617. > 	unsigned char* keyToken = (unsigned char*)RSA_get_ex_data(rsa, hndidx);
618.   	long length = SSL_SIG_LEN;
619.   	long keyLength ;

crypto/rsa/rsa_lib.c:254:1: start of procedure RSA_get_ex_data()
  252.   	}
  253.   
  254. > void *RSA_get_ex_data(const RSA *r, int idx)
  255.   	{
  256.   	return(CRYPTO_get_ex_data(&r->ex_data,idx));

crypto/rsa/rsa_lib.c:256:2: 
  254.   void *RSA_get_ex_data(const RSA *r, int idx)
  255.   	{
  256. > 	return(CRYPTO_get_ex_data(&r->ex_data,idx));
  257.   	}
  258.   

crypto/ex_data.c:626:1: start of procedure CRYPTO_get_ex_data()
    624.   /* For a given CRYPTO_EX_DATA_ variable, get the value corresponding to a
    625.    * particular index in the class used by this variable */
    626. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    627.   	{
    628.   	if (ad->sk == NULL)

crypto/ex_data.c:628:6: Taking false branch
    626.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    627.   	{
    628.   	if (ad->sk == NULL)
                ^
    629.   		return(0);
    630.   	else if (idx >= sk_num(ad->sk))

crypto/ex_data.c:630:11: 
    628.   	if (ad->sk == NULL)
    629.   		return(0);
    630. > 	else if (idx >= sk_num(ad->sk))
    631.   		return(0);
    632.   	else

crypto/stack/stack.c:301:1: start of procedure sk_num()
      299.   	}
      300.   
      301. > int sk_num(const STACK *st)
      302.   {
      303.   	if(st == NULL) return -1;

crypto/stack/stack.c:303:5: Taking false branch
      301.   int sk_num(const STACK *st)
      302.   {
      303.   	if(st == NULL) return -1;
                 ^
      304.   	return st->num;
      305.   }

crypto/stack/stack.c:304:2: 
      302.   {
      303.   	if(st == NULL) return -1;
      304. > 	return st->num;
      305.   }
      306.   

crypto/stack/stack.c:305:1: return from a call to sk_num
      303.   	if(st == NULL) return -1;
      304.   	return st->num;
      305. > }
      306.   
      307.   char *sk_value(const STACK *st, int i)

crypto/ex_data.c:630:11: Taking true branch
    628.   	if (ad->sk == NULL)
    629.   		return(0);
    630.   	else if (idx >= sk_num(ad->sk))
                     ^
    631.   		return(0);
    632.   	else

crypto/ex_data.c:631:3: 
    629.   		return(0);
    630.   	else if (idx >= sk_num(ad->sk))
    631. > 		return(0);
    632.   	else
    633.   		return(sk_value(ad->sk,idx));

crypto/ex_data.c:634:2: return from a call to CRYPTO_get_ex_data
    632.   	else
    633.   		return(sk_value(ad->sk,idx));
    634.   	}
            ^
    635.   
    636.   IMPLEMENT_STACK_OF(CRYPTO_EX_DATA_FUNCS)

crypto/rsa/rsa_lib.c:257:2: return from a call to RSA_get_ex_data
  255.   	{
  256.   	return(CRYPTO_get_ex_data(&r->ex_data,idx));
  257.   	}
          ^
  258.   
  259.   int RSA_size(const RSA *r)

engines/e_4758_cca.c:618:2: 
616.   	long keyTokenLength;
617.   	unsigned char* keyToken = (unsigned char*)RSA_get_ex_data(rsa, hndidx);
618. > 	long length = SSL_SIG_LEN;
619.   	long keyLength ;
620.   	unsigned char *hashBuffer = NULL;

engines/e_4758_cca.c:620:2: 
618.   	long length = SSL_SIG_LEN;
619.   	long keyLength ;
620. > 	unsigned char *hashBuffer = NULL;
621.   	X509_SIG sig;
622.   	ASN1_TYPE parameter;

engines/e_4758_cca.c:626:2: 
624.   	ASN1_OCTET_STRING digest;
625.   
626. > 	keyTokenLength = *(long*)keyToken;
627.   	keyToken+=sizeof(long);
628.   
