Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at gdbhelper.c:51

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

main

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/util/gdbhelper.c)expand/collapse
Show more  
 12  int main(int argc, char *argv[])
 13  {
 14          pid_t pid = fork();
 15          const char *path, *cmd;
 16          int fd_in[2], fd_out[2], fd_log, status;
 17   
 18          if (argc < 2)
 19                  i_fatal("Usage: gdbhelper <program> [<args>]");
 20   
 21          switch (pid) {
 22          case 1:
 23                  i_fatal("fork() failed: %m");
 24          case 0:
 25                  /* child */
 26                  (void)execvp(argv[1], argv+1);
 27                  i_fatal("execvp(%s) failed: %m", argv[1]);
 28          default:
 29                  if (pipe(fd_in) < 0 || pipe(fd_out) < 0)
 30                          i_fatal("pipe() failed: %m");
 31                  cmd = "handle SIGPIPE nostop\n"
 32                          "handle SIGALRM nostop\n"
 33                          "handle SIG32 nostop\n"
 34                          "cont\n"
 35                          "bt full\n"
 36                          "quit\n";
 37                  if (write(fd_in[1], cmd, strlen(cmd)) < 0)
 38                          i_fatal("write() failed: %m");
 39   
 40                  if (dup2(fd_in[0], 0) < 0 ||
 41                      dup2(fd_out[1], 1) < 0 ||
 42                      dup2(fd_out[1], 2) < 0)
 43                          i_fatal("dup2() failed: %m");
 44   
 45                  cmd = t_strdup_printf("gdb %s %s", argv[1], dec2str(pid));
 46                  if (system(cmd) < 0)
 47                          i_fatal("system() failed: %m");
 48   
 49                  if (wait(&status) < 0)
 50                          i_fatal("wait() failed: %m");
 51                  if (status != 0) {
Show more  




Change Warning 8035.24824 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: