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


apps/pkeyparam.c:82:1: start of procedure pkeyparam_main()
80.   };
81.   
82. > int pkeyparam_main(int argc, char **argv)
83.   {
84.       BIO *in = NULL, *out = NULL;

apps/pkeyparam.c:84:5: 
82.   int pkeyparam_main(int argc, char **argv)
83.   {
84. >     BIO *in = NULL, *out = NULL;
85.       EVP_PKEY *pkey = NULL;
86.       int text = 0, noout = 0, ret = 1;

apps/pkeyparam.c:85:5: 
83.   {
84.       BIO *in = NULL, *out = NULL;
85. >     EVP_PKEY *pkey = NULL;
86.       int text = 0, noout = 0, ret = 1;
87.       OPTION_CHOICE o;

apps/pkeyparam.c:86:5: 
84.       BIO *in = NULL, *out = NULL;
85.       EVP_PKEY *pkey = NULL;
86. >     int text = 0, noout = 0, ret = 1;
87.       OPTION_CHOICE o;
88.       char *infile = NULL, *outfile = NULL, *prog;

apps/pkeyparam.c:88:5: 
86.       int text = 0, noout = 0, ret = 1;
87.       OPTION_CHOICE o;
88. >     char *infile = NULL, *outfile = NULL, *prog;
89.   
90.       prog = opt_init(argc, argv, pkeyparam_options);

apps/pkeyparam.c:90:5: Skipping opt_init(): empty list of specs
88.       char *infile = NULL, *outfile = NULL, *prog;
89.   
90.       prog = opt_init(argc, argv, pkeyparam_options);
          ^
91.       while ((o = opt_next()) != OPT_EOF) {
92.           switch (o) {

apps/pkeyparam.c:91:12: Loop condition is false. Leaving loop
89.   
90.       prog = opt_init(argc, argv, pkeyparam_options);
91.       while ((o = opt_next()) != OPT_EOF) {
                 ^
92.           switch (o) {
93.           case OPT_EOF:

apps/pkeyparam.c:118:5: 
116.           }
117.       }
118. >     argc = opt_num_rest();
119.       argv = opt_rest();
120.   

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/pkeyparam.c:119:5: 
117.       }
118.       argc = opt_num_rest();
119. >     argv = opt_rest();
120.   
121.       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/pkeyparam.c:121:10: 
119.       argv = opt_rest();
120.   
121. >     if (!app_load_modules(NULL))
122.           goto end;
123.   

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/pkeyparam.c:121:10: Taking false branch
119.       argv = opt_rest();
120.   
121.       if (!app_load_modules(NULL))
                ^
122.           goto end;
123.   

apps/pkeyparam.c:124:5: 
122.           goto end;
123.   
124. >     in = bio_open_default(infile, "r");
125.       if (in == NULL)
126.           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)
