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


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

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

apps/speed.c:3619:5: 
3617.       static char sep[] = ":";
3618.   
3619. >     fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3620.       for (n = 0; n < multi; ++n) {
3621.           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:458:1: start of procedure CRYPTO_malloc()
    456.   }
    457.   
    458. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    459.   {
    460.       return c_CRYPTO_malloc(num, file, line);

providers/fips/fipsprov.c:460:5: Skipping __function_pointer__(): unresolved function pointer
    458.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    459.   {
    460.       return c_CRYPTO_malloc(num, file, line);
               ^
    461.   }
    462.   

providers/fips/fipsprov.c:461:1: return from a call to CRYPTO_malloc
    459.   {
    460.       return c_CRYPTO_malloc(num, file, line);
    461. > }
    462.   
    463.   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:3620:10: 
3618.   
3619.       fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3620. >     for (n = 0; n < multi; ++n) {
3621.           if (pipe(fd) == -1) {
3622.               BIO_printf(bio_err, "pipe failure\n");

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

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

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

apps/speed.c:3626:15: 
3624.           }
3625.           fflush(stdout);
3626. >         (void)BIO_flush(bio_err);
3627.           if (fork()) {
3628.               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:3626:9: 
3624.           }
3625.           fflush(stdout);
3626. >         (void)BIO_flush(bio_err);
3627.           if (fork()) {
3628.               close(fd[1]);

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

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

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

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

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

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

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

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

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

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