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


apps/nseq.c:30:1: start of procedure nseq_main()
28.   };
29.   
30. > int nseq_main(int argc, char **argv)
31.   {
32.       BIO *in = NULL, *out = NULL;

apps/nseq.c:32:5: 
30.   int nseq_main(int argc, char **argv)
31.   {
32. >     BIO *in = NULL, *out = NULL;
33.       X509 *x509 = NULL;
34.       NETSCAPE_CERT_SEQUENCE *seq = NULL;

apps/nseq.c:33:5: 
31.   {
32.       BIO *in = NULL, *out = NULL;
33. >     X509 *x509 = NULL;
34.       NETSCAPE_CERT_SEQUENCE *seq = NULL;
35.       OPTION_CHOICE o;

apps/nseq.c:34:5: 
32.       BIO *in = NULL, *out = NULL;
33.       X509 *x509 = NULL;
34. >     NETSCAPE_CERT_SEQUENCE *seq = NULL;
35.       OPTION_CHOICE o;
36.       int toseq = 0, ret = 1, i;

apps/nseq.c:36:5: 
34.       NETSCAPE_CERT_SEQUENCE *seq = NULL;
35.       OPTION_CHOICE o;
36. >     int toseq = 0, ret = 1, i;
37.       char *infile = NULL, *outfile = NULL, *prog;
38.   

apps/nseq.c:37:5: 
35.       OPTION_CHOICE o;
36.       int toseq = 0, ret = 1, i;
37. >     char *infile = NULL, *outfile = NULL, *prog;
38.   
39.       prog = opt_init(argc, argv, nseq_options);

apps/nseq.c:39:5: Skipping opt_init(): empty list of specs
37.       char *infile = NULL, *outfile = NULL, *prog;
38.   
39.       prog = opt_init(argc, argv, nseq_options);
          ^
40.       while ((o = opt_next()) != OPT_EOF) {
41.           switch (o) {

apps/nseq.c:40:12: Loop condition is false. Leaving loop
38.   
39.       prog = opt_init(argc, argv, nseq_options);
40.       while ((o = opt_next()) != OPT_EOF) {
                 ^
41.           switch (o) {
42.           case OPT_EOF:

apps/nseq.c:62:5: 
60.           }
61.       }
62. >     argc = opt_num_rest();
63.       if (argc != 0)
64.           goto opthelp;

apps/opt.c:788:1: start of procedure opt_num_rest()
  786.   
  787.   /* How many items in remaining args? */
  788. > int opt_num_rest(void)
  789.   {
  790.       int i = 0;

apps/opt.c:790:5: 
  788.   int opt_num_rest(void)
  789.   {
  790. >     int i = 0;
  791.       char **pp;
  792.   

apps/opt.c:793:10: 
  791.       char **pp;
  792.   
  793. >     for (pp = opt_rest(); *pp; pp++, i++)
  794.           continue;
  795.       return i;

apps/opt.c:782:1: start of procedure opt_rest()
    780.   
    781.   /* Return the rest of the arguments after parsing flags. */
    782. > char **opt_rest(void)
    783.   {
    784.       return &argv[opt_index];

apps/opt.c:784:5: 
    782.   char **opt_rest(void)
    783.   {
    784. >     return &argv[opt_index];
    785.   }
    786.   

apps/opt.c:785:1: return from a call to opt_rest
    783.   {
    784.       return &argv[opt_index];
    785. > }
    786.   
    787.   /* How many items in remaining args? */

apps/opt.c:793:27: Loop condition is false. Leaving loop
  791.       char **pp;
  792.   
  793.       for (pp = opt_rest(); *pp; pp++, i++)
                                   ^
  794.           continue;
  795.       return i;

apps/opt.c:795:5: 
  793.       for (pp = opt_rest(); *pp; pp++, i++)
  794.           continue;
  795. >     return i;
  796.   }
  797.   

apps/opt.c:796:1: return from a call to opt_num_rest
  794.           continue;
  795.       return i;
  796. > }
  797.   
  798.   /* Return a string describing the parameter type. */

apps/nseq.c:63:9: Taking false branch
61.       }
62.       argc = opt_num_rest();
63.       if (argc != 0)
              ^
64.           goto opthelp;
65.   

apps/nseq.c:66:5: 
64.           goto opthelp;
65.   
66. >     in = bio_open_default(infile, 'r', FORMAT_PEM);
67.       if (in == NULL)
68.           goto end;

apps/apps.c:2448:1: start of procedure bio_open_default()
  2446.   }
  2447.   
  2448. > BIO *bio_open_default(const char *filename, char mode, int format)
  2449.   {
  2450.       return bio_open_default_(filename, mode, format, 0);

apps/apps.c:2450:5: 
  2448.   BIO *bio_open_default(const char *filename, char mode, int format)
  2449.   {
  2450. >     return bio_open_default_(filename, mode, format, 0);
  2451.   }
  2452.   

apps/apps.c:2416:1: start of procedure bio_open_default_()
    2414.   }
    2415.   
    2416. > static BIO *bio_open_default_(const char *filename, char mode, int format,
    2417.                                 int quiet)
    2418.   {

apps/apps.c:2421:9: Taking false branch
    2419.       BIO *ret;
    2420.   
    2421.       if (filename == NULL || strcmp(filename, "-") == 0) {
                    ^
    2422.           ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
    2423.           if (quiet) {

apps/apps.c:2421:29: Taking true branch
    2419.       BIO *ret;
    2420.   
    2421.       if (filename == NULL || strcmp(filename, "-") == 0) {
                                        ^
    2422.           ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
    2423.           if (quiet) {

apps/apps.c:2422:15: Condition is true
    2420.   
    2421.       if (filename == NULL || strcmp(filename, "-") == 0) {
    2422.           ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
                          ^
    2423.           if (quiet) {
    2424.               ERR_clear_error();

apps/apps.c:2257:1: start of procedure dup_bio_in()
      2255.    * text and binary input/output on non-Unix platforms
      2256.    */
      2257. > BIO *dup_bio_in(int format)
      2258.   {
      2259.       return BIO_new_fp(stdin,

apps/apps.c:2260:38: 
      2258.   {
      2259.       return BIO_new_fp(stdin,
      2260. >                       BIO_NOCLOSE | (FMT_istext(format) ? BIO_FP_TEXT : 0));
      2261.   }
      2262.   

apps/fmt.c:12:1: start of procedure FMT_istext()
        10.   #include "fmt.h"
        11.   
        12. > int FMT_istext(int format)
        13.   {
        14.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;

apps/fmt.c:14:12: Condition is true
        12.   int FMT_istext(int format)
        13.   {
        14.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
                         ^
        15.   }

apps/fmt.c:14:5: 
        12.   int FMT_istext(int format)
        13.   {
        14. >     return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
        15.   }

apps/fmt.c:15:1: return from a call to FMT_istext
        13.   {
        14.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
        15. > }

apps/apps.c:2260:38: Condition is true
      2258.   {
      2259.       return BIO_new_fp(stdin,
      2260.                         BIO_NOCLOSE | (FMT_istext(format) ? BIO_FP_TEXT : 0));
                                                   ^
      2261.   }
      2262.   

apps/apps.c:2259:5: 
      2257.   BIO *dup_bio_in(int format)
      2258.   {
      2259. >     return BIO_new_fp(stdin,
      2260.                         BIO_NOCLOSE | (FMT_istext(format) ? BIO_FP_TEXT : 0));
      2261.   }

crypto/bio/bss_file.c:95:1: start of procedure BIO_new_fp()
        93.   }
        94.   
        95. > BIO *BIO_new_fp(FILE *stream, int close_flag)
        96.   {
        97.       BIO *ret;

crypto/bio/bss_file.c:99:9: 
        97.       BIO *ret;
        98.   
        99. >     if ((ret = BIO_new(BIO_s_file())) == NULL)
        100.           return NULL;
        101.   

crypto/bio/bss_file.c:108:1: start of procedure BIO_s_file()
          106.   }
          107.   
          108. > const BIO_METHOD *BIO_s_file(void)
          109.   {
          110.       return &methods_filep;

crypto/bio/bss_file.c:110:5: 
          108.   const BIO_METHOD *BIO_s_file(void)
          109.   {
          110. >     return &methods_filep;
          111.   }
          112.   

crypto/bio/bss_file.c:111:1: return from a call to BIO_s_file
          109.   {
          110.       return &methods_filep;
          111. > }
          112.   
          113.   static int file_new(BIO *bi)

crypto/bio/bss_file.c:99:9: Taking true branch
        97.       BIO *ret;
        98.   
        99.       if ((ret = BIO_new(BIO_s_file())) == NULL)
                       ^
        100.           return NULL;
        101.   

crypto/bio/bss_file.c:100:9: 
        98.   
        99.       if ((ret = BIO_new(BIO_s_file())) == NULL)
        100. >         return NULL;
        101.   
        102.       /* redundant flag, left for documentation purposes */

crypto/bio/bss_file.c:106:1: return from a call to BIO_new_fp
        104.       BIO_set_fp(ret, stream, close_flag);
        105.       return ret;
        106. > }
        107.   
        108.   const BIO_METHOD *BIO_s_file(void)

apps/apps.c:2261:1: return from a call to dup_bio_in
      2259.       return BIO_new_fp(stdin,
      2260.                         BIO_NOCLOSE | (FMT_istext(format) ? BIO_FP_TEXT : 0));
      2261. > }
      2262.   
      2263.   BIO *dup_bio_out(int format)

apps/apps.c:2422:9: 
    2420.   
    2421.       if (filename == NULL || strcmp(filename, "-") == 0) {
    2422. >         ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
    2423.           if (quiet) {
    2424.               ERR_clear_error();

apps/apps.c:2423:13: Taking false branch
    2421.       if (filename == NULL || strcmp(filename, "-") == 0) {
    2422.           ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
    2423.           if (quiet) {
                        ^
    2424.               ERR_clear_error();
    2425.               return ret;

apps/apps.c:2427:13: Taking false branch
    2425.               return ret;
    2426.           }
    2427.           if (ret != NULL)
                        ^
    2428.               return ret;
    2429.           BIO_printf(bio_err,

apps/apps.c:2431:20: Condition is true
    2429.           BIO_printf(bio_err,
    2430.                      "Can't open %s, %s\n",
    2431.                      mode == 'r' ? "stdin" : "stdout", strerror(errno));
                               ^
    2432.       } else {
    2433.           ret = BIO_new_file(filename, modestr(mode, format));

apps/apps.c:2429:9: Skipping BIO_printf(): empty list of specs
    2427.           if (ret != NULL)
    2428.               return ret;
    2429.           BIO_printf(bio_err,
                    ^
    2430.                      "Can't open %s, %s\n",
    2431.                      mode == 'r' ? "stdin" : "stdout", strerror(errno));

apps/apps.c:2444:5: 
    2442.                      filename, modeverb(mode), strerror(errno));
    2443.       }
    2444. >     ERR_print_errors(bio_err);
    2445.       return NULL;
    2446.   }

crypto/err/err_prn.c:50:1: start of procedure ERR_print_errors()
      48.   }
      49.   
      50. > void ERR_print_errors(BIO *bp)
      51.   {
      52.       ERR_print_errors_cb(print_bio, bp);

crypto/err/err_prn.c:52:5: 
      50.   void ERR_print_errors(BIO *bp)
      51.   {
      52. >     ERR_print_errors_cb(print_bio, bp);
      53.   }
      54.   

crypto/err/err_prn.c:16:1: start of procedure ERR_print_errors_cb()
        14.   #include <openssl/err.h>
        15.   
        16. > void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
        17.                            void *u)
        18.   {

crypto/err/err_prn.c:33:5: 
        31.       } tid;
        32.   
        33. >     tid.ltid = 0;
        34.       tid.tid = CRYPTO_THREAD_get_current_id();
        35.   

crypto/err/err_prn.c:34:5: 
        32.   
        33.       tid.ltid = 0;
        34. >     tid.tid = CRYPTO_THREAD_get_current_id();
        35.   
        36.       while ((l = ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) {

crypto/threads_pthread.c:148:1: start of procedure CRYPTO_THREAD_get_current_id()
          146.   }
          147.   
          148. > CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
          149.   {
          150.       return pthread_self();

crypto/threads_pthread.c:150:5: Skipping pthread_self(): method has no implementation
          148.   CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
          149.   {
          150.       return pthread_self();
                     ^
          151.   }
          152.   

crypto/threads_pthread.c:151:1: return from a call to CRYPTO_THREAD_get_current_id
          149.   {
          150.       return pthread_self();
          151. > }
          152.   
          153.   int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)

crypto/err/err_prn.c:36:12: 
        34.       tid.tid = CRYPTO_THREAD_get_current_id();
        35.   
        36. >     while ((l = ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) {
        37.           ERR_error_string_n(l, buf, sizeof(buf));
        38.           BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", tid.ltid, buf,

crypto/err/err.c:469:1: start of procedure ERR_get_error_line_data()
          467.   }
          468.   
          469. > unsigned long ERR_get_error_line_data(const char **file, int *line,
          470.                                         const char **data, int *flags)
          471.   {

crypto/err/err.c:472:5: 
          470.                                         const char **data, int *flags)
          471.   {
          472. >     return get_error_values(1, 0, file, line, data, flags);
          473.   }
          474.   

crypto/err/err.c:507:1: start of procedure get_error_values()
            505.   }
            506.   
            507. > static unsigned long get_error_values(int inc, int top, const char **file,
            508.                                         int *line, const char **data,
            509.                                         int *flags)

crypto/err/err.c:511:5: 
            509.                                         int *flags)
            510.   {
            511. >     int i = 0;
            512.       ERR_STATE *es;
            513.       unsigned long ret;

crypto/err/err.c:515:5: 
            513.       unsigned long ret;
            514.   
            515. >     es = ERR_get_state();
            516.       if (es == NULL)
            517.           return 0;

crypto/err/err.c:720:1: start of procedure ERR_get_state()
              718.   }
              719.   
              720. > ERR_STATE *ERR_get_state(void)
              721.   {
              722.       ERR_STATE *state;

crypto/err/err.c:723:5: 
              721.   {
              722.       ERR_STATE *state;
              723. >     int saveerrno = get_last_sys_error();
              724.   
              725.       if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))

crypto/err/err.c:725:10: Taking true branch
              723.       int saveerrno = get_last_sys_error();
              724.   
              725.       if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
                              ^
              726.           return NULL;
              727.   

crypto/err/err.c:726:9: 
              724.   
              725.       if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
              726. >         return NULL;
              727.   
              728.       if (!RUN_ONCE(&err_init, err_do_init))

crypto/err/err.c:757:1: return from a call to ERR_get_state
              755.       set_sys_error(saveerrno);
              756.       return state;
              757. > }
              758.   
              759.   /*

crypto/err/err.c:516:9: Taking true branch
            514.   
            515.       es = ERR_get_state();
            516.       if (es == NULL)
                           ^
            517.           return 0;
            518.   

crypto/err/err.c:517:9: 
            515.       es = ERR_get_state();
            516.       if (es == NULL)
            517. >         return 0;
            518.   
            519.       if (inc && top) {

crypto/err/err.c:587:1: return from a call to get_error_values
            585.       }
            586.       return ret;
            587. > }
            588.   
            589.   void ERR_error_string_n(unsigned long e, char *buf, size_t len)

crypto/err/err.c:473:1: return from a call to ERR_get_error_line_data
          471.   {
          472.       return get_error_values(1, 0, file, line, data, flags);
          473. > }
          474.   
          475.   unsigned long ERR_peek_error(void)

crypto/err/err_prn.c:36:12: Loop condition is false. Leaving loop
        34.       tid.tid = CRYPTO_THREAD_get_current_id();
        35.   
        36.       while ((l = ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) {
                         ^
        37.           ERR_error_string_n(l, buf, sizeof(buf));
        38.           BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", tid.ltid, buf,

crypto/err/err_prn.c:43:1: return from a call to ERR_print_errors_cb
        41.               break;              /* abort outputting the error report */
        42.       }
        43. > }
        44.   
        45.   static int print_bio(const char *str, size_t len, void *bp)

crypto/err/err_prn.c:53:1: return from a call to ERR_print_errors
      51.   {
      52.       ERR_print_errors_cb(print_bio, bp);
      53. > }
      54.   
      55.   #ifndef OPENSSL_NO_STDIO

apps/apps.c:2445:5: 
    2443.       }
    2444.       ERR_print_errors(bio_err);
    2445. >     return NULL;
    2446.   }
    2447.   

apps/apps.c:2446:1: return from a call to bio_open_default_
    2444.       ERR_print_errors(bio_err);
    2445.       return NULL;
    2446. > }
    2447.   
    2448.   BIO *bio_open_default(const char *filename, char mode, int format)

apps/apps.c:2451:1: return from a call to bio_open_default
  2449.   {
  2450.       return bio_open_default_(filename, mode, format, 0);
  2451. > }
  2452.   
  2453.   BIO *bio_open_default_quiet(const char *filename, char mode, int format)
