crypto/x509/x509_lu.c:516: error: NULL_DEREFERENCE
  pointer `obj` last assigned on line 515 could be null and is dereferenced at line 516, column 13.
Showing all 25 steps of the trace


crypto/x509/x509_lu.c:485:1: start of procedure X509_STORE_get1_certs()
483.   }
484.   
485. > STACK_OF(X509) *X509_STORE_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm)
486.   {
487.       int i, idx, cnt;

crypto/x509/x509_lu.c:491:5: 
489.       X509 *x;
490.       X509_OBJECT *obj;
491. >     sk = sk_X509_new_null();
492.       CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
493.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt);

crypto/stack/stack.c:152:1: start of procedure sk_new_null()
  150.   }
  151.   
  152. > _STACK *sk_new_null(void)
  153.   {
  154.       return sk_new((int (*)(const void *, const void *))0);

crypto/stack/stack.c:154:5: Skipping sk_new(): empty list of specs
  152.   _STACK *sk_new_null(void)
  153.   {
  154.       return sk_new((int (*)(const void *, const void *))0);
             ^
  155.   }
  156.   

crypto/stack/stack.c:155:1: return from a call to sk_new_null
  153.   {
  154.       return sk_new((int (*)(const void *, const void *))0);
  155. > }
  156.   
  157.   _STACK *sk_new(int (*c) (const void *, const void *))

crypto/x509/x509_lu.c:492:5: 
490.       X509_OBJECT *obj;
491.       sk = sk_X509_new_null();
492. >     CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
493.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt);
494.       if (idx < 0) {

crypto/lock.c:417:1: start of procedure CRYPTO_lock()
  415.   }
  416.   
  417. > void CRYPTO_lock(int mode, int type, const char *file, int line)
  418.   {
  419.   #ifdef LOCK_DEBUG

crypto/lock.c:444:9: Taking false branch
  442.       }
  443.   #endif
  444.       if (type < 0) {
                 ^
  445.           if (dynlock_lock_callback != NULL) {
  446.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:455:16: Taking true branch
  453.               CRYPTO_destroy_dynlockid(type);
  454.           }
  455.       } else if (locking_callback != NULL)
                        ^
  456.           locking_callback(mode, type, file, line);
  457.   }

crypto/lock.c:456:9: Skipping __function_pointer__(): unresolved function pointer
  454.           }
  455.       } else if (locking_callback != NULL)
  456.           locking_callback(mode, type, file, line);
                 ^
  457.   }
  458.   

crypto/lock.c:444:5: 
  442.       }
  443.   #endif
  444. >     if (type < 0) {
  445.           if (dynlock_lock_callback != NULL) {
  446.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:457:1: return from a call to CRYPTO_lock
  455.       } else if (locking_callback != NULL)
  456.           locking_callback(mode, type, file, line);
  457. > }
  458.   
  459.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/x509/x509_lu.c:493:5: Skipping x509_object_idx_cnt(): empty list of specs
491.       sk = sk_X509_new_null();
492.       CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
493.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt);
           ^
494.       if (idx < 0) {
495.           /*

crypto/x509/x509_lu.c:494:9: Taking false branch
492.       CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
493.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt);
494.       if (idx < 0) {
               ^
495.           /*
496.            * Nothing found in cache: do lookup to possibly add new objects to

crypto/x509/x509_lu.c:514:10: 
512.           }
513.       }
514. >     for (i = 0; i < cnt; i++, idx++) {
515.           obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
516.           x = obj->data.x509;

crypto/x509/x509_lu.c:514:17: Loop condition is true. Entering loop body
512.           }
513.       }
514.       for (i = 0; i < cnt; i++, idx++) {
                       ^
515.           obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
516.           x = obj->data.x509;

crypto/x509/x509_lu.c:515:15: Condition is true
513.       }
514.       for (i = 0; i < cnt; i++, idx++) {
515.           obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
                     ^
516.           x = obj->data.x509;
517.           CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);

crypto/x509/x509_lu.c:515:9: 
513.       }
514.       for (i = 0; i < cnt; i++, idx++) {
515. >         obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
516.           x = obj->data.x509;
517.           CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);

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 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:28: 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/x509/x509_lu.c:516:9: 
514.       for (i = 0; i < cnt; i++, idx++) {
515.           obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
516. >         x = obj->data.x509;
517.           CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
518.           if (!sk_X509_push(sk, x)) {
