apps/speed.c:3654: error: NULL_DEREFERENCE
  pointer `f` last assigned on line 3653 could be null and is dereferenced by call to `fgets()` at line 3654, column 16.
Showing all 30 steps of the trace


apps/speed.c:3613:1: start of procedure do_multi()
3611.   }
3612.   
3613. > static int do_multi(int multi, int size_num)
3614.   {
3615.       int n;

apps/speed.c:3618:5: 
3616.       int fd[2];
3617.       int *fds;
3618. >     static char sep[] = ":";
3619.   
3620.       fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");

apps/speed.c:3620:5: 
3618.       static char sep[] = ":";
3619.   
3620. >     fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3621.       for (n = 0; n < multi; ++n) {
3622.           if (pipe(fd) == -1) {

test/testutil/apps_mem.c:14:1: start of procedure app_malloc()
  12.   /* shim that avoids sucking in too much from apps/apps.c */
  13.   
  14. > void* app_malloc(int sz, const char *what)
  15.   {
  16.       void *vp = OPENSSL_malloc(sz);

test/testutil/apps_mem.c:16:5: 
  14.   void* app_malloc(int sz, const char *what)
  15.   {
  16. >     void *vp = OPENSSL_malloc(sz);
  17.   
  18.       return vp;

providers/fips/fipsprov.c:564:1: start of procedure CRYPTO_malloc()
    562.   }
    563.   
    564. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    565.   {
    566.       return c_CRYPTO_malloc(num, file, line);

providers/fips/fipsprov.c:566:5: Skipping __function_pointer__(): unresolved function pointer
    564.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    565.   {
    566.       return c_CRYPTO_malloc(num, file, line);
               ^
    567.   }
    568.   

providers/fips/fipsprov.c:567:1: return from a call to CRYPTO_malloc
    565.   {
    566.       return c_CRYPTO_malloc(num, file, line);
    567. > }
    568.   
    569.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

test/testutil/apps_mem.c:18:5: 
  16.       void *vp = OPENSSL_malloc(sz);
  17.   
  18. >     return vp;
  19.   }

test/testutil/apps_mem.c:19:1: return from a call to app_malloc
  17.   
  18.       return vp;
  19. > }

apps/speed.c:3621:10: 
3619.   
3620.       fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3621. >     for (n = 0; n < multi; ++n) {
3622.           if (pipe(fd) == -1) {
3623.               BIO_printf(bio_err, "pipe failure\n");

apps/speed.c:3621:17: Loop condition is true. Entering loop body
3619.   
3620.       fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3621.       for (n = 0; n < multi; ++n) {
                        ^
3622.           if (pipe(fd) == -1) {
3623.               BIO_printf(bio_err, "pipe failure\n");

apps/speed.c:3622:13: Taking false branch
3620.       fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3621.       for (n = 0; n < multi; ++n) {
3622.           if (pipe(fd) == -1) {
                    ^
3623.               BIO_printf(bio_err, "pipe failure\n");
3624.               exit(1);

apps/speed.c:3626:9: 
3624.               exit(1);
3625.           }
3626. >         fflush(stdout);
3627.           (void)BIO_flush(bio_err);
3628.           if (fork()) {

apps/speed.c:3627:15: 
3625.           }
3626.           fflush(stdout);
3627. >         (void)BIO_flush(bio_err);
3628.           if (fork()) {
3629.               close(fd[1]);

crypto/bio/bio_lib.c:510:1: start of procedure BIO_ctrl()
  508.   }
  509.   
  510. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
  511.   {
  512.       long ret;

crypto/bio/bio_lib.c:514:9: Taking true branch
  512.       long ret;
  513.   
  514.       if (b == NULL)
                 ^
  515.           return 0;
  516.   

crypto/bio/bio_lib.c:515:9: 
  513.   
  514.       if (b == NULL)
  515. >         return 0;
  516.   
  517.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {

crypto/bio/bio_lib.c:535:1: return from a call to BIO_ctrl
  533.   
  534.       return ret;
  535. > }
  536.   
  537.   long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)

apps/speed.c:3627:9: 
3625.           }
3626.           fflush(stdout);
3627. >         (void)BIO_flush(bio_err);
3628.           if (fork()) {
3629.               close(fd[1]);

apps/speed.c:3628:13: Taking true branch
3626.           fflush(stdout);
3627.           (void)BIO_flush(bio_err);
3628.           if (fork()) {
                    ^
3629.               close(fd[1]);
3630.               fds[n] = fd[0];

apps/speed.c:3629:13: 
3627.           (void)BIO_flush(bio_err);
3628.           if (fork()) {
3629. >             close(fd[1]);
3630.               fds[n] = fd[0];
3631.           } else {

apps/speed.c:3630:13: 
3628.           if (fork()) {
3629.               close(fd[1]);
3630. >             fds[n] = fd[0];
3631.           } else {
3632.               close(fd[0]);

apps/speed.c:3644:9: 
3642.               return 0;
3643.           }
3644. >         printf("Forked child %d\n", n);
3645.       }
3646.   

apps/speed.c:3621:28: 
3619.   
3620.       fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3621. >     for (n = 0; n < multi; ++n) {
3622.           if (pipe(fd) == -1) {
3623.               BIO_printf(bio_err, "pipe failure\n");

apps/speed.c:3621:17: Loop condition is false. Leaving loop
3619.   
3620.       fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3621.       for (n = 0; n < multi; ++n) {
                        ^
3622.           if (pipe(fd) == -1) {
3623.               BIO_printf(bio_err, "pipe failure\n");

apps/speed.c:3648:10: 
3646.   
3647.       /* for now, assume the pipe is long enough to take all the output */
3648. >     for (n = 0; n < multi; ++n) {
3649.           FILE *f;
3650.           char buf[1024];

apps/speed.c:3648:17: Loop condition is true. Entering loop body
3646.   
3647.       /* for now, assume the pipe is long enough to take all the output */
3648.       for (n = 0; n < multi; ++n) {
                        ^
3649.           FILE *f;
3650.           char buf[1024];

apps/speed.c:3653:9: 
3651.           char *p;
3652.   
3653. >         f = fdopen(fds[n], "r");
3654.           while (fgets(buf, sizeof(buf), f)) {
3655.               p = strchr(buf, '\n');

apps/speed.c:3654:16: 
3652.   
3653.           f = fdopen(fds[n], "r");
3654. >         while (fgets(buf, sizeof(buf), f)) {
3655.               p = strchr(buf, '\n');
3656.               if (p)
