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


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

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

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

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

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

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

engines/e_4758cca.c:757:2: 
755.   	long keyTokenLength;
756.   	unsigned char *hashBuffer = NULL;
757. > 	unsigned char* keyToken = (unsigned char*)RSA_get_ex_data(rsa, hndidx);
758.   	long length = SSL_SIG_LEN;
759.   	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: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_void_num(ad->sk))

crypto/ex_data.c:630:18: Condition is true
    628.   	if (ad->sk == NULL)
    629.   		return(0);
    630.   	else if (idx >= sk_void_num(ad->sk))
                            ^
    631.   		return(0);
    632.   	else

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

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

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

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

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

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

crypto/ex_data.c:633:10: Condition is true
    631.   		return(0);
    632.   	else
    633.   		return(sk_void_value(ad->sk,idx));
                    ^
    634.   	}
    635.   

crypto/ex_data.c:633:3: 
    631.   		return(0);
    632.   	else
    633. > 		return(sk_void_value(ad->sk,idx));
    634.   	}
    635.   

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

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

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

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

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

crypto/ex_data.c:634:2: return from a call to CRYPTO_get_ex_data
    632.   	else
    633.   		return(sk_void_value(ad->sk,idx));
    634.   	}
            ^
    635.   
    636.   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:758:2: 
756.   	unsigned char *hashBuffer = NULL;
757.   	unsigned char* keyToken = (unsigned char*)RSA_get_ex_data(rsa, hndidx);
758. > 	long length = SSL_SIG_LEN;
759.   	long keyLength ;
760.   	X509_SIG sig;

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