apps/nseq.c:115: error: NULL_DEREFERENCE
  pointer `infile` last assigned on line 85 could be null and is dereferenced by call to `bio_open_default()` at line 115, column 10.
Showing all 47 steps of the trace


apps/nseq.c:78:1: start of procedure nseq_main()
76.   };
77.   
78. > int nseq_main(int argc, char **argv)
79.   {
80.       BIO *in = NULL, *out = NULL;

apps/nseq.c:80:5: 
78.   int nseq_main(int argc, char **argv)
79.   {
80. >     BIO *in = NULL, *out = NULL;
81.       X509 *x509 = NULL;
82.       NETSCAPE_CERT_SEQUENCE *seq = NULL;

apps/nseq.c:81:5: 
79.   {
80.       BIO *in = NULL, *out = NULL;
81. >     X509 *x509 = NULL;
82.       NETSCAPE_CERT_SEQUENCE *seq = NULL;
83.       OPTION_CHOICE o;

apps/nseq.c:82:5: 
80.       BIO *in = NULL, *out = NULL;
81.       X509 *x509 = NULL;
82. >     NETSCAPE_CERT_SEQUENCE *seq = NULL;
83.       OPTION_CHOICE o;
84.       int toseq = 0, ret = 1, i;

apps/nseq.c:84:5: 
82.       NETSCAPE_CERT_SEQUENCE *seq = NULL;
83.       OPTION_CHOICE o;
84. >     int toseq = 0, ret = 1, i;
85.       char *infile = NULL, *outfile = NULL, *prog;
86.   

apps/nseq.c:85:5: 
83.       OPTION_CHOICE o;
84.       int toseq = 0, ret = 1, i;
85. >     char *infile = NULL, *outfile = NULL, *prog;
86.   
87.       prog = opt_init(argc, argv, nseq_options);

apps/nseq.c:87:5: Skipping opt_init(): empty list of specs
85.       char *infile = NULL, *outfile = NULL, *prog;
86.   
87.       prog = opt_init(argc, argv, nseq_options);
          ^
88.       while ((o = opt_next()) != OPT_EOF) {
89.           switch (o) {

apps/nseq.c:88:12: Loop condition is false. Leaving loop
86.   
87.       prog = opt_init(argc, argv, nseq_options);
88.       while ((o = opt_next()) != OPT_EOF) {
                 ^
89.           switch (o) {
90.           case OPT_EOF:

apps/nseq.c:109:5: 
107.           }
108.       }
109. >     argc = opt_num_rest();
110.       argv = opt_rest();
111.   

apps/opt.c:721:1: start of procedure opt_num_rest()
  719.   
  720.   /* How many items in remaining args? */
  721. > int opt_num_rest(void)
  722.   {
  723.       int i = 0;

apps/opt.c:723:5: 
  721.   int opt_num_rest(void)
  722.   {
  723. >     int i = 0;
  724.       char **pp;
  725.   

apps/opt.c:726:10: 
  724.       char **pp;
  725.   
  726. >     for (pp = opt_rest(); *pp; pp++, i++)
  727.           continue;
  728.       return i;

apps/opt.c:715:1: start of procedure opt_rest()
    713.   
    714.   /* Return the rest of the arguments after parsing flags. */
    715. > char **opt_rest(void)
    716.   {
    717.       return &argv[opt_index];

apps/opt.c:717:5: 
    715.   char **opt_rest(void)
    716.   {
    717. >     return &argv[opt_index];
    718.   }
    719.   

apps/opt.c:718:1: return from a call to opt_rest
    716.   {
    717.       return &argv[opt_index];
    718. > }
    719.   
    720.   /* How many items in remaining args? */

apps/opt.c:726:27: Loop condition is false. Leaving loop
  724.       char **pp;
  725.   
  726.       for (pp = opt_rest(); *pp; pp++, i++)
                                   ^
  727.           continue;
  728.       return i;

apps/opt.c:728:5: 
  726.       for (pp = opt_rest(); *pp; pp++, i++)
  727.           continue;
  728. >     return i;
  729.   }
  730.   

apps/opt.c:729:1: return from a call to opt_num_rest
  727.           continue;
  728.       return i;
  729. > }
  730.   
  731.   /* Return a string describing the parameter type. */

apps/nseq.c:110:5: 
108.       }
109.       argc = opt_num_rest();
110. >     argv = opt_rest();
111.   
112.       if (!app_load_modules(NULL))

apps/opt.c:715:1: start of procedure opt_rest()
  713.   
  714.   /* Return the rest of the arguments after parsing flags. */
  715. > char **opt_rest(void)
  716.   {
  717.       return &argv[opt_index];

apps/opt.c:717:5: 
  715.   char **opt_rest(void)
  716.   {
  717. >     return &argv[opt_index];
  718.   }
  719.   

apps/opt.c:718:1: return from a call to opt_rest
  716.   {
  717.       return &argv[opt_index];
  718. > }
  719.   
  720.   /* How many items in remaining args? */

apps/nseq.c:112:10: 
110.       argv = opt_rest();
111.   
112. >     if (!app_load_modules(NULL))
113.           goto end;
114.   

apps/apps.c:539:1: start of procedure app_load_modules()
  537.   }
  538.   
  539. > int app_load_modules(const CONF *config)
  540.   {
  541.       CONF *to_free = NULL;

apps/apps.c:541:5: 
  539.   int app_load_modules(const CONF *config)
  540.   {
  541. >     CONF *to_free = NULL;
  542.   
  543.       if (config == NULL)

apps/apps.c:543:9: Taking true branch
  541.       CONF *to_free = NULL;
  542.   
  543.       if (config == NULL)
                 ^
  544.   	config = to_free = app_load_config_quiet(default_config_file);
  545.       if (config == NULL)

apps/apps.c:544:2: Skipping app_load_config_quiet(): empty list of specs
  542.   
  543.       if (config == NULL)
  544.   	config = to_free = app_load_config_quiet(default_config_file);
          ^
  545.       if (config == NULL)
  546.   	return 1;

apps/apps.c:545:9: Taking true branch
  543.       if (config == NULL)
  544.   	config = to_free = app_load_config_quiet(default_config_file);
  545.       if (config == NULL)
                 ^
  546.   	return 1;
  547.   

apps/apps.c:546:2: 
  544.   	config = to_free = app_load_config_quiet(default_config_file);
  545.       if (config == NULL)
  546. > 	return 1;
  547.   
  548.       if (CONF_modules_load(config, NULL, 0) <= 0) {

apps/apps.c:556:1: return from a call to app_load_modules
  554.       NCONF_free(to_free);
  555.       return 1;
  556. > }
  557.   
  558.   int add_oid_section(CONF *conf)

apps/nseq.c:112:10: Taking false branch
110.       argv = opt_rest();
111.   
112.       if (!app_load_modules(NULL))
                ^
113.           goto end;
114.   

apps/nseq.c:115:5: 
113.           goto end;
114.   
115. >     in = bio_open_default(infile, "r");
116.       if (in == NULL)
117.           goto end;

apps/openssl.c:387:1: start of procedure bio_open_default()
  385.   }
  386.   
  387. > BIO *bio_open_default(const char *filename, const char *mode)
  388.   {
  389.       return bio_open_default_(filename, mode, 0);

apps/openssl.c:389:5: 
  387.   BIO *bio_open_default(const char *filename, const char *mode)
  388.   {
  389. >     return bio_open_default_(filename, mode, 0);
  390.   }
  391.   

apps/openssl.c:355:1: start of procedure bio_open_default_()
    353.   }
    354.   
    355. > static BIO *bio_open_default_(const char *filename, const char *mode, int quiet)
    356.   {
    357.       BIO *ret;

apps/openssl.c:359:9: Taking false branch
    357.       BIO *ret;
    358.   
    359.       if (filename == NULL || strcmp(filename, "-") == 0) {
                   ^
    360.           ret = *mode == 'r' ? dup_bio_in() : dup_bio_out();
    361.           if (quiet) {

apps/openssl.c:359:29: Taking true branch
    357.       BIO *ret;
    358.   
    359.       if (filename == NULL || strcmp(filename, "-") == 0) {
                                       ^
    360.           ret = *mode == 'r' ? dup_bio_in() : dup_bio_out();
    361.           if (quiet) {

apps/openssl.c:360:15: Condition is true
    358.   
    359.       if (filename == NULL || strcmp(filename, "-") == 0) {
    360.           ret = *mode == 'r' ? dup_bio_in() : dup_bio_out();
                         ^
    361.           if (quiet) {
    362.               ERR_clear_error();

apps/openssl.c:283:1: start of procedure dup_bio_in()
      281.   }
      282.   
      283. > BIO *dup_bio_in(void)
      284.   {
      285.       return BIO_new_fp(stdin, BIO_NOCLOSE | BIO_FP_TEXT);

apps/openssl.c:285:5: Skipping BIO_new_fp(): empty list of specs
      283.   BIO *dup_bio_in(void)
      284.   {
      285.       return BIO_new_fp(stdin, BIO_NOCLOSE | BIO_FP_TEXT);
                 ^
      286.   }
      287.   

apps/openssl.c:286:1: return from a call to dup_bio_in
      284.   {
      285.       return BIO_new_fp(stdin, BIO_NOCLOSE | BIO_FP_TEXT);
      286. > }
      287.   
      288.   BIO *dup_bio_out(void)

apps/openssl.c:360:9: 
    358.   
    359.       if (filename == NULL || strcmp(filename, "-") == 0) {
    360. >         ret = *mode == 'r' ? dup_bio_in() : dup_bio_out();
    361.           if (quiet) {
    362.               ERR_clear_error();

apps/openssl.c:361:13: Taking false branch
    359.       if (filename == NULL || strcmp(filename, "-") == 0) {
    360.           ret = *mode == 'r' ? dup_bio_in() : dup_bio_out();
    361.           if (quiet) {
                       ^
    362.               ERR_clear_error();
    363.               return ret;

apps/openssl.c:365:13: Taking true branch
    363.               return ret;
    364.           }
    365.           if (ret != NULL)
                       ^
    366.               return ret;
    367.           BIO_printf(bio_err,

apps/openssl.c:366:13: 
    364.           }
    365.           if (ret != NULL)
    366. >             return ret;
    367.           BIO_printf(bio_err,
    368.                      "Can't open %s, %s\n",

apps/openssl.c:385:1: return from a call to bio_open_default_
    383.       ERR_print_errors(bio_err);
    384.       return NULL;
    385. > }
    386.   
    387.   BIO *bio_open_default(const char *filename, const char *mode)

apps/openssl.c:390:1: return from a call to bio_open_default
  388.   {
  389.       return bio_open_default_(filename, mode, 0);
  390. > }
  391.   
  392.   BIO *bio_open_default_quiet(const char *filename, const char *mode)
