apps/pkeyparam.c:121: error: NULL_DEREFERENCE
  pointer `infile` last assigned on line 88 could be null and is dereferenced by call to `bio_open_default()` at line 121, column 10.
Showing all 55 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:720:1: start of procedure opt_num_rest()
  718.   
  719.   /* How many items in remaining args? */
  720. > int opt_num_rest(void)
  721.   {
  722.       int i = 0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

apps/pkeyparam.c:119:5: 
117.       }
118.       argc = opt_num_rest();
119. >     argv = opt_rest();
120.   
121.       in = bio_open_default(infile, 'r', FORMAT_PEM);

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

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

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

apps/pkeyparam.c:121:5: 
119.       argv = opt_rest();
120.   
121. >     in = bio_open_default(infile, 'r', FORMAT_PEM);
122.       if (in == NULL)
123.           goto end;

apps/apps.c:2880:1: start of procedure bio_open_default()
  2878.   }
  2879.   
  2880. > BIO *bio_open_default(const char *filename, char mode, int format)
  2881.   {
  2882.       return bio_open_default_(filename, mode, format, 0);

apps/apps.c:2882:5: 
  2880.   BIO *bio_open_default(const char *filename, char mode, int format)
  2881.   {
  2882. >     return bio_open_default_(filename, mode, format, 0);
  2883.   }
  2884.   

apps/apps.c:2848:1: start of procedure bio_open_default_()
    2846.   }
    2847.   
    2848. > static BIO *bio_open_default_(const char *filename, char mode, int format,
    2849.                                 int quiet)
    2850.   {

apps/apps.c:2853:9: Taking false branch
    2851.       BIO *ret;
    2852.   
    2853.       if (filename == NULL || strcmp(filename, "-") == 0) {
                    ^
    2854.           ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
    2855.           if (quiet) {

apps/apps.c:2853:29: Taking true branch
    2851.       BIO *ret;
    2852.   
    2853.       if (filename == NULL || strcmp(filename, "-") == 0) {
                                        ^
    2854.           ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
    2855.           if (quiet) {

apps/apps.c:2854:15: Condition is true
    2852.   
    2853.       if (filename == NULL || strcmp(filename, "-") == 0) {
    2854.           ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
                          ^
    2855.           if (quiet) {
    2856.               ERR_clear_error();

apps/apps.c:2744:1: start of procedure dup_bio_in()
      2742.   }
      2743.   
      2744. > BIO *dup_bio_in(int format)
      2745.   {
      2746.       return BIO_new_fp(stdin,

apps/apps.c:2747:38: 
      2745.   {
      2746.       return BIO_new_fp(stdin,
      2747. >                       BIO_NOCLOSE | (istext(format) ? BIO_FP_TEXT : 0));
      2748.   }
      2749.   

apps/apps.c:2739:1: start of procedure istext()
        2737.    * text and binary input/output on non-Unix platforms
        2738.    */
        2739. > static int istext(int format)
        2740.   {
        2741.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;

apps/apps.c:2741:12: Condition is true
        2739.   static int istext(int format)
        2740.   {
        2741.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
                           ^
        2742.   }
        2743.   

apps/apps.c:2741:5: 
        2739.   static int istext(int format)
        2740.   {
        2741. >     return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
        2742.   }
        2743.   

apps/apps.c:2742:1: return from a call to istext
        2740.   {
        2741.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
        2742. > }
        2743.   
        2744.   BIO *dup_bio_in(int format)

apps/apps.c:2747:38: Condition is true
      2745.   {
      2746.       return BIO_new_fp(stdin,
      2747.                         BIO_NOCLOSE | (istext(format) ? BIO_FP_TEXT : 0));
                                                   ^
      2748.   }
      2749.   

apps/apps.c:2746:5: Skipping BIO_new_fp(): empty list of specs
      2744.   BIO *dup_bio_in(int format)
      2745.   {
      2746.       return BIO_new_fp(stdin,
                  ^
      2747.                         BIO_NOCLOSE | (istext(format) ? BIO_FP_TEXT : 0));
      2748.   }

apps/apps.c:2748:1: return from a call to dup_bio_in
      2746.       return BIO_new_fp(stdin,
      2747.                         BIO_NOCLOSE | (istext(format) ? BIO_FP_TEXT : 0));
      2748. > }
      2749.   
      2750.   BIO *dup_bio_out(int format)

apps/apps.c:2854:9: 
    2852.   
    2853.       if (filename == NULL || strcmp(filename, "-") == 0) {
    2854. >         ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
    2855.           if (quiet) {
    2856.               ERR_clear_error();

apps/apps.c:2855:13: Taking false branch
    2853.       if (filename == NULL || strcmp(filename, "-") == 0) {
    2854.           ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
    2855.           if (quiet) {
                        ^
    2856.               ERR_clear_error();
    2857.               return ret;

apps/apps.c:2859:13: Taking true branch
    2857.               return ret;
    2858.           }
    2859.           if (ret != NULL)
                        ^
    2860.               return ret;
    2861.           BIO_printf(bio_err,

apps/apps.c:2860:13: 
    2858.           }
    2859.           if (ret != NULL)
    2860. >             return ret;
    2861.           BIO_printf(bio_err,
    2862.                      "Can't open %s, %s\n",

apps/apps.c:2878:1: return from a call to bio_open_default_
    2876.       ERR_print_errors(bio_err);
    2877.       return NULL;
    2878. > }
    2879.   
    2880.   BIO *bio_open_default(const char *filename, char mode, int format)

apps/apps.c:2883:1: return from a call to bio_open_default
  2881.   {
  2882.       return bio_open_default_(filename, mode, format, 0);
  2883. > }
  2884.   
  2885.   BIO *bio_open_default_quiet(const char *filename, char mode, int format)
