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


test/ssltestlib.c:116:1: start of procedure copy_flags()
114.   }
115.   
116. > static void copy_flags(BIO *bio)
117.   {
118.       int flags;

test/ssltestlib.c:119:5: 
117.   {
118.       int flags;
119. >     BIO *next = BIO_next(bio);
120.   
121.       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:121:5: 
119.       BIO *next = BIO_next(bio);
120.   
121. >     flags = BIO_test_flags(next, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);
122.       BIO_clear_flags(bio, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);
123.       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.   
