engines/e_4758cca.c:764: error: NULL_DEREFERENCE
  pointer `keyToken` last assigned on line 756 could be null and is dereferenced at line 764, column 19.
Showing all 27 steps of the trace


engines/e_4758cca.c:743:1: start of procedure cca_rsa_sign()
741.   #define SSL_SIG_LEN 36
742.   
743. > static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len,
744.   		unsigned char *sigret, unsigned int *siglen, const RSA *rsa)
745.   	{

engines/e_4758cca.c:748:2: 
746.   	long returnCode;
747.   	long reasonCode;
748. > 	long exitDataLength = 0;
749.   	unsigned char exitData[8];
750.   	long ruleArrayLength = 1;

engines/e_4758cca.c:750:2: 
748.   	long exitDataLength = 0;
749.   	unsigned char exitData[8];
750. > 	long ruleArrayLength = 1;
751.   	unsigned char ruleArray[8] = "PKCS-1.1";
752.   	long outputLength=256;

engines/e_4758cca.c:751:2: 
749.   	unsigned char exitData[8];
750.   	long ruleArrayLength = 1;
751. > 	unsigned char ruleArray[8] = "PKCS-1.1";
752.   	long outputLength=256;
753.   	long outputBitLength;

engines/e_4758cca.c:752:2: 
750.   	long ruleArrayLength = 1;
751.   	unsigned char ruleArray[8] = "PKCS-1.1";
752. > 	long outputLength=256;
753.   	long outputBitLength;
754.   	long keyTokenLength;

engines/e_4758cca.c:755:2: 
753.   	long outputBitLength;
754.   	long keyTokenLength;
755. > 	unsigned char *hashBuffer = NULL;
756.   	unsigned char* keyToken = (unsigned char*)RSA_get_ex_data(rsa, hndidx);
757.   	long length = SSL_SIG_LEN;

engines/e_4758cca.c:756:2: 
754.   	long keyTokenLength;
755.   	unsigned char *hashBuffer = NULL;
756. > 	unsigned char* keyToken = (unsigned char*)RSA_get_ex_data(rsa, hndidx);
757.   	long length = SSL_SIG_LEN;
758.   	long keyLength ;

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

crypto/rsa/rsa_lib.c:271:2: 
  269.   void *RSA_get_ex_data(const RSA *r, int idx)
  270.   	{
  271. > 	return(CRYPTO_get_ex_data(&r->ex_data,idx));
  272.   	}
  273.   

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

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

crypto/ex_data.c:626:11: 
    624.   	if (ad->sk == NULL)
    625.   		return(0);
    626. > 	else if (idx >= sk_num(ad->sk))
    627.   		return(0);
    628.   	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:626:11: Taking false branch
    624.   	if (ad->sk == NULL)
    625.   		return(0);
    626.   	else if (idx >= sk_num(ad->sk))
                     ^
    627.   		return(0);
    628.   	else

crypto/ex_data.c:629:3: 
    627.   		return(0);
    628.   	else
    629. > 		return(sk_value(ad->sk,idx));
    630.   	}
    631.   

crypto/stack/stack.c:307:1: start of procedure sk_value()
      305.   }
      306.   
      307. > char *sk_value(const STACK *st, int i)
      308.   {
      309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:309:6: Taking false branch
      307.   char *sk_value(const STACK *st, int i)
      308.   {
      309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                  ^
      310.   	return st->data[i];
      311.   }

crypto/stack/stack.c:309:13: Taking true branch
      307.   char *sk_value(const STACK *st, int i)
      308.   {
      309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                         ^
      310.   	return st->data[i];
      311.   }

crypto/stack/stack.c:309:39: 
      307.   char *sk_value(const STACK *st, int i)
      308.   {
      309. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
      310.   	return st->data[i];
      311.   }

crypto/stack/stack.c:311:1: return from a call to sk_value
      309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
      310.   	return st->data[i];
      311. > }
      312.   
      313.   char *sk_set(STACK *st, int i, char *value)

crypto/ex_data.c:630:2: return from a call to CRYPTO_get_ex_data
    628.   	else
    629.   		return(sk_value(ad->sk,idx));
    630.   	}
            ^
    631.   
    632.   IMPLEMENT_STACK_OF(CRYPTO_EX_DATA_FUNCS)

crypto/rsa/rsa_lib.c:272:2: return from a call to RSA_get_ex_data
  270.   	{
  271.   	return(CRYPTO_get_ex_data(&r->ex_data,idx));
  272.   	}
          ^
  273.   
  274.   int RSA_size(const RSA *r)

engines/e_4758cca.c:757:2: 
755.   	unsigned char *hashBuffer = NULL;
756.   	unsigned char* keyToken = (unsigned char*)RSA_get_ex_data(rsa, hndidx);
757. > 	long length = SSL_SIG_LEN;
758.   	long keyLength ;
759.   	X509_SIG sig;

engines/e_4758cca.c:764:2: 
762.   	ASN1_OCTET_STRING digest;
763.   
764. > 	keyTokenLength = *(long*)keyToken;
765.   	keyToken+=sizeof(long);
766.   
