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


engines/e_4758cca.c:722:1: start of procedure cca_rsa_sign()
720.   #   define SSL_SIG_LEN 36
721.   
722. > static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len,
723.                           unsigned char *sigret, unsigned int *siglen,
724.                           const RSA *rsa)

engines/e_4758cca.c:728:5: 
726.       long returnCode;
727.       long reasonCode;
728. >     long exitDataLength = 0;
729.       unsigned char exitData[8];
730.       long ruleArrayLength = 1;

engines/e_4758cca.c:730:5: 
728.       long exitDataLength = 0;
729.       unsigned char exitData[8];
730. >     long ruleArrayLength = 1;
731.       unsigned char ruleArray[8] = "PKCS-1.1";
732.       long outputLength = 256;

engines/e_4758cca.c:731:5: 
729.       unsigned char exitData[8];
730.       long ruleArrayLength = 1;
731. >     unsigned char ruleArray[8] = "PKCS-1.1";
732.       long outputLength = 256;
733.       long outputBitLength;

engines/e_4758cca.c:732:5: 
730.       long ruleArrayLength = 1;
731.       unsigned char ruleArray[8] = "PKCS-1.1";
732. >     long outputLength = 256;
733.       long outputBitLength;
734.       long keyTokenLength;

engines/e_4758cca.c:735:5: 
733.       long outputBitLength;
734.       long keyTokenLength;
735. >     unsigned char *hashBuffer = NULL;
736.       unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
737.       long length = SSL_SIG_LEN;

engines/e_4758cca.c:736:5: 
734.       long keyTokenLength;
735.       unsigned char *hashBuffer = NULL;
736. >     unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
737.       long length = SSL_SIG_LEN;
738.       long keyLength;

crypto/rsa/rsa_lib.c:278:1: start of procedure RSA_get_ex_data()
  276.   }
  277.   
  278. > void *RSA_get_ex_data(const RSA *r, int idx)
  279.   {
  280.       return (CRYPTO_get_ex_data(&r->ex_data, idx));

crypto/rsa/rsa_lib.c:280:5: 
  278.   void *RSA_get_ex_data(const RSA *r, int idx)
  279.   {
  280. >     return (CRYPTO_get_ex_data(&r->ex_data, idx));
  281.   }
  282.   

crypto/ex_data.c:634:1: start of procedure CRYPTO_get_ex_data()
    632.    * particular index in the class used by this variable
    633.    */
    634. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    635.   {
    636.       if (ad->sk == NULL)

crypto/ex_data.c:636:9: Taking false branch
    634.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    635.   {
    636.       if (ad->sk == NULL)
                   ^
    637.           return (0);
    638.       else if (idx >= sk_void_num(ad->sk))

crypto/ex_data.c:638:21: Condition is true
    636.       if (ad->sk == NULL)
    637.           return (0);
    638.       else if (idx >= sk_void_num(ad->sk))
                               ^
    639.           return (0);
    640.       else

crypto/ex_data.c:638:14: 
    636.       if (ad->sk == NULL)
    637.           return (0);
    638. >     else if (idx >= sk_void_num(ad->sk))
    639.           return (0);
    640.       else

crypto/stack/stack.c:340:1: start of procedure sk_num()
      338.   }
      339.   
      340. > int sk_num(const _STACK *st)
      341.   {
      342.       if (st == NULL)

crypto/stack/stack.c:342:9: Taking false branch
      340.   int sk_num(const _STACK *st)
      341.   {
      342.       if (st == NULL)
                     ^
      343.           return -1;
      344.       return st->num;

crypto/stack/stack.c:344:5: 
      342.       if (st == NULL)
      343.           return -1;
      344. >     return st->num;
      345.   }
      346.   

crypto/stack/stack.c:345:1: return from a call to sk_num
      343.           return -1;
      344.       return st->num;
      345. > }
      346.   
      347.   void *sk_value(const _STACK *st, int i)

crypto/ex_data.c:638:14: Taking false branch
    636.       if (ad->sk == NULL)
    637.           return (0);
    638.       else if (idx >= sk_void_num(ad->sk))
                        ^
    639.           return (0);
    640.       else

crypto/ex_data.c:641:17: Condition is true
    639.           return (0);
    640.       else
    641.           return (sk_void_value(ad->sk, idx));
                           ^
    642.   }
    643.   

crypto/ex_data.c:641:9: 
    639.           return (0);
    640.       else
    641. >         return (sk_void_value(ad->sk, idx));
    642.   }
    643.   

crypto/stack/stack.c:347:1: start of procedure sk_value()
      345.   }
      346.   
      347. > void *sk_value(const _STACK *st, int i)
      348.   {
      349.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:349:10: Taking false branch
      347.   void *sk_value(const _STACK *st, int i)
      348.   {
      349.       if (!st || (i < 0) || (i >= st->num))
                      ^
      350.           return NULL;
      351.       return st->data[i];

crypto/stack/stack.c:349:17: Taking true branch
      347.   void *sk_value(const _STACK *st, int i)
      348.   {
      349.       if (!st || (i < 0) || (i >= st->num))
                             ^
      350.           return NULL;
      351.       return st->data[i];

crypto/stack/stack.c:350:9: 
      348.   {
      349.       if (!st || (i < 0) || (i >= st->num))
      350. >         return NULL;
      351.       return st->data[i];
      352.   }

crypto/stack/stack.c:352:1: return from a call to sk_value
      350.           return NULL;
      351.       return st->data[i];
      352. > }
      353.   
      354.   void *sk_set(_STACK *st, int i, void *value)

crypto/ex_data.c:642:1: return from a call to CRYPTO_get_ex_data
    640.       else
    641.           return (sk_void_value(ad->sk, idx));
    642. > }
    643.   
    644.   IMPLEMENT_STACK_OF(CRYPTO_EX_DATA_FUNCS)

crypto/rsa/rsa_lib.c:281:1: return from a call to RSA_get_ex_data
  279.   {
  280.       return (CRYPTO_get_ex_data(&r->ex_data, idx));
  281. > }
  282.   
  283.   int RSA_memory_lock(RSA *r)

engines/e_4758cca.c:737:5: 
735.       unsigned char *hashBuffer = NULL;
736.       unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
737. >     long length = SSL_SIG_LEN;
738.       long keyLength;
739.       X509_SIG sig;

engines/e_4758cca.c:744:5: 
742.       ASN1_OCTET_STRING digest;
743.   
744. >     keyTokenLength = *(long *)keyToken;
745.       keyToken += sizeof(long);
746.   
