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


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

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

crypto/bio/bio_lib.c:485:1: start of procedure BIO_next()
  483.   }
  484.   
  485. > BIO *BIO_next(BIO *b)
  486.   {
  487.       if (b == NULL)

crypto/bio/bio_lib.c:487:9: Taking true branch
  485.   BIO *BIO_next(BIO *b)
  486.   {
  487.       if (b == NULL)
                 ^
  488.           return NULL;
  489.       return b->next_bio;

crypto/bio/bio_lib.c:488:9: 
  486.   {
  487.       if (b == NULL)
  488. >         return NULL;
  489.       return b->next_bio;
  490.   }

crypto/bio/bio_lib.c:490:1: return from a call to BIO_next
  488.           return NULL;
  489.       return b->next_bio;
  490. > }
  491.   
  492.   void BIO_set_next(BIO *b, BIO *next)

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

crypto/bio/bio_lib.c:135:1: start of procedure BIO_test_flags()
  133.   }
  134.   
  135. > int BIO_test_flags(const BIO *b, int flags)
  136.   {
  137.       return (b->flags & flags);

crypto/bio/bio_lib.c:137:5: 
  135.   int BIO_test_flags(const BIO *b, int flags)
  136.   {
  137. >     return (b->flags & flags);
  138.   }
  139.   

static void copy_flags(BIO *bio)
{
    int flags;
    BIO *next = BIO_next(bio);
    flags = BIO_test_flags(next, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);
    BIO_clear_flags(bio, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);
    BIO_set_flags(bio, flags);
}
['static void copy_flags(BIO *bio)\n{\n    int flags;\n    BIO *next = BIO_next(bio);\n    flags = BIO_test_flags(next, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);\n    BIO_clear_flags(bio, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS);\n    BIO_set_flags(bio, flags);\n}', 'BIO *BIO_next(BIO *b)\n{\n    if (b == NULL)\n        return NULL;\n    return b->next_bio;\n}', 'int BIO_test_flags(const BIO *b, int flags)\n{\n    return (b->flags & flags);\n}']