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


crypto/x509/x509_lu.c:522:1: start of procedure X509_STORE_get1_crls()
520.   }
521.   
522. > STACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm)
523.   {
524.       int i, idx, cnt;

crypto/x509/x509_lu.c:528:5: 
526.       X509_CRL *x;
527.       X509_OBJECT *obj, xobj;
528. >     sk = sk_X509_CRL_new_null();
529.       CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
530.       /* Check cache first */

crypto/stack/stack.c:145:1: start of procedure sk_new_null()
  143.   }
  144.   
  145. > _STACK *sk_new_null(void)
  146.   {
  147.       return sk_new((int (*)(const void *, const void *))0);

crypto/stack/stack.c:147:5: Skipping sk_new(): empty list of specs
  145.   _STACK *sk_new_null(void)
  146.   {
  147.       return sk_new((int (*)(const void *, const void *))0);
             ^
  148.   }
  149.   

crypto/stack/stack.c:148:1: return from a call to sk_new_null
  146.   {
  147.       return sk_new((int (*)(const void *, const void *))0);
  148. > }
  149.   
  150.   _STACK *sk_new(int (*c) (const void *, const void *))

crypto/x509/x509_lu.c:529:5: 
527.       X509_OBJECT *obj, xobj;
528.       sk = sk_X509_CRL_new_null();
529. >     CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
530.       /* Check cache first */
531.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt);

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:531:5: Skipping x509_object_idx_cnt(): empty list of specs
529.       CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
530.       /* Check cache first */
531.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt);
           ^
532.   
533.       /*

crypto/x509/x509_lu.c:536:5: 
534.        * Always do lookup to possibly add new CRLs to cache
535.        */
536. >     CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
537.       if (!X509_STORE_get_by_subject(ctx, X509_LU_CRL, nm, &xobj)) {
538.           sk_X509_CRL_free(sk);

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:537:10: Taking false branch
535.        */
536.       CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
537.       if (!X509_STORE_get_by_subject(ctx, X509_LU_CRL, nm, &xobj)) {
                ^
538.           sk_X509_CRL_free(sk);
539.           return NULL;

crypto/x509/x509_lu.c:541:5: 
539.           return NULL;
540.       }
541. >     X509_OBJECT_free_contents(&xobj);
542.       CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
543.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt);

crypto/x509/x509_lu.c:402:1: start of procedure X509_OBJECT_free_contents()
  400.   }
  401.   
  402. > void X509_OBJECT_free_contents(X509_OBJECT *a)
  403.   {
  404.       if (!a)

crypto/x509/x509_lu.c:404:10: Taking false branch
  402.   void X509_OBJECT_free_contents(X509_OBJECT *a)
  403.   {
  404.       if (!a)
                  ^
  405.           return;
  406.       switch (a->type) {

crypto/x509/x509_lu.c:406:5: 
  404.       if (!a)
  405.           return;
  406. >     switch (a->type) {
  407.       default:
  408.           break;

crypto/x509/x509_lu.c:409:5: Switch condition is false. Skipping switch case
  407.       default:
  408.           break;
  409.       case X509_LU_X509:
             ^
  410.           X509_free(a->data.x509);
  411.           break;

crypto/x509/x509_lu.c:412:5: Switch condition is false. Skipping switch case
  410.           X509_free(a->data.x509);
  411.           break;
  412.       case X509_LU_CRL:
             ^
  413.           X509_CRL_free(a->data.crl);
  414.           break;

crypto/x509/x509_lu.c:416:1: return from a call to X509_OBJECT_free_contents
  414.           break;
  415.       }
  416. > }
  417.   
  418.   static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type,

crypto/x509/x509_lu.c:542:5: 
540.       }
541.       X509_OBJECT_free_contents(&xobj);
542. >     CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
543.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt);
544.       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:543:5: Skipping x509_object_idx_cnt(): empty list of specs
541.       X509_OBJECT_free_contents(&xobj);
542.       CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
543.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt);
           ^
544.       if (idx < 0) {
545.           CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);

crypto/x509/x509_lu.c:544:9: Taking false branch
542.       CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
543.       idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt);
544.       if (idx < 0) {
               ^
545.           CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
546.           sk_X509_CRL_free(sk);

crypto/x509/x509_lu.c:550:10: 
548.       }
549.   
550. >     for (i = 0; i < cnt; i++, idx++) {
551.           obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
552.           x = obj->data.crl;

crypto/x509/x509_lu.c:550:17: Loop condition is true. Entering loop body
548.       }
549.   
550.       for (i = 0; i < cnt; i++, idx++) {
                       ^
551.           obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
552.           x = obj->data.crl;

crypto/x509/x509_lu.c:551:15: Condition is true
549.   
550.       for (i = 0; i < cnt; i++, idx++) {
551.           obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
                     ^
552.           x = obj->data.crl;
553.           X509_CRL_up_ref(x);

crypto/x509/x509_lu.c:551:9: 
549.   
550.       for (i = 0; i < cnt; i++, idx++) {
551. >         obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
552.           x = obj->data.crl;
553.           X509_CRL_up_ref(x);

crypto/stack/stack.c:324:1: start of procedure sk_value()
  322.   }
  323.   
  324. > void *sk_value(const _STACK *st, int i)
  325.   {
  326.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:326:10: Taking false branch
  324.   void *sk_value(const _STACK *st, int i)
  325.   {
  326.       if (!st || (i < 0) || (i >= st->num))
                  ^
  327.           return NULL;
  328.       return st->data[i];

crypto/stack/stack.c:326:17: Taking false branch
  324.   void *sk_value(const _STACK *st, int i)
  325.   {
  326.       if (!st || (i < 0) || (i >= st->num))
                         ^
  327.           return NULL;
  328.       return st->data[i];

crypto/stack/stack.c:326:28: Taking true branch
  324.   void *sk_value(const _STACK *st, int i)
  325.   {
  326.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  327.           return NULL;
  328.       return st->data[i];

crypto/stack/stack.c:327:9: 
  325.   {
  326.       if (!st || (i < 0) || (i >= st->num))
  327. >         return NULL;
  328.       return st->data[i];
  329.   }

crypto/stack/stack.c:329:1: return from a call to sk_value
  327.           return NULL;
  328.       return st->data[i];
  329. > }
  330.   
  331.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_lu.c:552:9: 
550.       for (i = 0; i < cnt; i++, idx++) {
551.           obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx);
552. >         x = obj->data.crl;
553.           X509_CRL_up_ref(x);
554.           if (!sk_X509_CRL_push(sk, x)) {
