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


engines/e_4758cca.c:571:1: start of procedure cca_rsa_priv_dec()
569.   }
570.   
571. > static int cca_rsa_priv_dec(int flen, const unsigned char *from,
572.                               unsigned char *to, RSA *rsa, int padding)
573.   {

engines/e_4758cca.c:576:5: 
574.       long returnCode;
575.       long reasonCode;
576. >     long lflen = flen;
577.       long exitDataLength = 0;
578.       unsigned char exitData[8];

engines/e_4758cca.c:577:5: 
575.       long reasonCode;
576.       long lflen = flen;
577. >     long exitDataLength = 0;
578.       unsigned char exitData[8];
579.       long ruleArrayLength = 1;

engines/e_4758cca.c:579:5: 
577.       long exitDataLength = 0;
578.       unsigned char exitData[8];
579. >     long ruleArrayLength = 1;
580.       unsigned char ruleArray[8] = "PKCS-1.2";
581.       long dataStructureLength = 0;

engines/e_4758cca.c:580:5: 
578.       unsigned char exitData[8];
579.       long ruleArrayLength = 1;
580. >     unsigned char ruleArray[8] = "PKCS-1.2";
581.       long dataStructureLength = 0;
582.       unsigned char dataStructure[8];

engines/e_4758cca.c:581:5: 
579.       long ruleArrayLength = 1;
580.       unsigned char ruleArray[8] = "PKCS-1.2";
581. >     long dataStructureLength = 0;
582.       unsigned char dataStructure[8];
583.       long outputLength = RSA_size(rsa);

engines/e_4758cca.c:583:5: 
581.       long dataStructureLength = 0;
582.       unsigned char dataStructure[8];
583. >     long outputLength = RSA_size(rsa);
584.       long keyTokenLength;
585.       unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);

crypto/rsa/rsa_crpt.c:72:1: start of procedure RSA_size()
  70.   }
  71.   
  72. > int RSA_size(const RSA *r)
  73.   {
  74.       return (BN_num_bytes(r->n));

crypto/rsa/rsa_crpt.c:74:5: 
  72.   int RSA_size(const RSA *r)
  73.   {
  74. >     return (BN_num_bytes(r->n));
  75.   }
  76.   

crypto/bn/bn_lib.c:214:1: start of procedure BN_num_bits()
    212.   }
    213.   
    214. > int BN_num_bits(const BIGNUM *a)
    215.   {
    216.       int i = a->top - 1;

crypto/bn/bn_lib.c:216:5: 
    214.   int BN_num_bits(const BIGNUM *a)
    215.   {
    216. >     int i = a->top - 1;
    217.       bn_check_top(a);
    218.   

crypto/bn/bn_lib.c:219:9: 
    217.       bn_check_top(a);
    218.   
    219. >     if (BN_is_zero(a))
    220.           return 0;
    221.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:897:1: start of procedure BN_is_zero()
      895.   }
      896.   
      897. > int BN_is_zero(const BIGNUM *a)
      898.   {
      899.       return a->top == 0;

crypto/bn/bn_lib.c:899:12: Condition is false
      897.   int BN_is_zero(const BIGNUM *a)
      898.   {
      899.       return a->top == 0;
                        ^
      900.   }
      901.   

crypto/bn/bn_lib.c:899:5: 
      897.   int BN_is_zero(const BIGNUM *a)
      898.   {
      899. >     return a->top == 0;
      900.   }
      901.   

crypto/bn/bn_lib.c:900:1: return from a call to BN_is_zero
      898.   {
      899.       return a->top == 0;
      900. > }
      901.   
      902.   int BN_is_one(const BIGNUM *a)

crypto/bn/bn_lib.c:219:9: Taking false branch
    217.       bn_check_top(a);
    218.   
    219.       if (BN_is_zero(a))
                   ^
    220.           return 0;
    221.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:221:5: Skipping BN_num_bits_word(): empty list of specs
    219.       if (BN_is_zero(a))
    220.           return 0;
    221.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
               ^
    222.   }
    223.   

crypto/bn/bn_lib.c:222:1: return from a call to BN_num_bits
    220.           return 0;
    221.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
    222. > }
    223.   
    224.   static void bn_free_d(BIGNUM *a)

crypto/rsa/rsa_crpt.c:75:1: return from a call to RSA_size
  73.   {
  74.       return (BN_num_bytes(r->n));
  75. > }
  76.   
  77.   int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to,

engines/e_4758cca.c:585:5: 
583.       long outputLength = RSA_size(rsa);
584.       long keyTokenLength;
585. >     unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
586.   
587.       keyTokenLength = *(long *)keyToken;

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:587:5: 
585.       unsigned char *keyToken = (unsigned char *)RSA_get_ex_data(rsa, hndidx);
586.   
587. >     keyTokenLength = *(long *)keyToken;
588.       keyToken += sizeof(long);
589.   
