test/ssltestlib.c:73: error: NULL_DEREFERENCE
  pointer `next` last assigned on line 71 could be null and is dereferenced by call to `BIO_test_flags()` at line 73, column 13.
Showing all 9 steps of the trace


test/ssltestlib.c:68:1: start of procedure copy_flags()
66.   }
67.   
68. > static void copy_flags(BIO *bio)
69.   {
70.       int flags;

test/ssltestlib.c:71:5: 
69.   {
70.       int flags;
71. >     BIO *next = BIO_next(bio);
72.   
73.       flags = BIO_test_flags(next, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);

crypto/bio/bio_lib.c:670:1: start of procedure BIO_next()
  668.   }
  669.   
  670. > BIO *BIO_next(BIO *b)
  671.   {
  672.       if (b == NULL)

crypto/bio/bio_lib.c:672:9: Taking true branch
  670.   BIO *BIO_next(BIO *b)
  671.   {
  672.       if (b == NULL)
                 ^
  673.           return NULL;
  674.       return b->next_bio;

crypto/bio/bio_lib.c:673:9: 
  671.   {
  672.       if (b == NULL)
  673. >         return NULL;
  674.       return b->next_bio;
  675.   }

crypto/bio/bio_lib.c:675:1: return from a call to BIO_next
  673.           return NULL;
  674.       return b->next_bio;
  675. > }
  676.   
  677.   void BIO_set_next(BIO *b, BIO *next)

test/ssltestlib.c:73:5: 
71.       BIO *next = BIO_next(bio);
72.   
73. >     flags = BIO_test_flags(next, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);
74.       BIO_clear_flags(bio, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);
75.       BIO_set_flags(bio, flags);

crypto/bio/bio_lib.c:194:1: start of procedure BIO_test_flags()
  192.   }
  193.   
  194. > int BIO_test_flags(const BIO *b, int flags)
  195.   {
  196.       return (b->flags & flags);

crypto/bio/bio_lib.c:196:5: 
  194.   int BIO_test_flags(const BIO *b, int flags)
  195.   {
  196. >     return (b->flags & flags);
  197.   }
  198.   
