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


test/ssltestlib.c:96:1: start of procedure copy_flags()
94.   }
95.   
96. > static void copy_flags(BIO *bio)
97.   {
98.       int flags;

test/ssltestlib.c:99:5: 
97.   {
98.       int flags;
99. >     BIO *next = BIO_next(bio);
100.   
101.       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:101:5: 
99.       BIO *next = BIO_next(bio);
100.   
101. >     flags = BIO_test_flags(next, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);
102.       BIO_clear_flags(bio, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);
103.       BIO_set_flags(bio, flags);

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

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