Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at client.c:187

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/login-common/main.c)expand/collapse
Show more  
 397  int main(int argc ATTR_UNUSED, char *argv[], char *envp[])
 398  {
 399          const char *group_name;
 400          struct ip_addr remote_ip, local_ip;
 401          unsigned int remote_port, local_port, max_fds;
 402          struct ssl_proxy *proxy = NULL;
 403          struct client *client;
 404          int i, fd = -1, master_fd = -1;
 405          bool ssl = FALSE;
 406   
 407          is_inetd = getenv("DOVECOT_MASTER") == NULL;
 408   
 409  #ifdef DEBUG 
 410          if (!is_inetd && getenv("GDB") == NULL) {
 411                  const char *env;
 412   
 413                  i =  + 1;
 414                  env = getenv("LISTEN_FDS");
 415                  if (env != NULL) i += atoi(env);
 416                  env = getenv("SSL_LISTEN_FDS");
 417                  if (env != NULL) i += atoi(env);
 418   
 419                  fd_debug_verify_leaks(i, 1024);
 420          }
 421  #endif
 422          /* NOTE: we start rooted, so keep the code minimal until
 423             restrict_access_by_env() is called */
 424          lib_init();
 425   
 426          if (is_inetd) {
 427                  /* running from inetd. create master process before
 428                     dropping privileges. */
 429                  process_name = strrchr(argv[0], '/');
 430                  process_name = process_name == NULL ? argv[0] : process_name+1;
 431                  group_name = t_strcut(process_name, '-');
 432   
 433                  for (i = 1; i < argc; i++) {
 434                          if (strncmp(argv[i], "--group=", 8) == 0) {
 435                                  group_name = argv[1]+8;
 436                                  break;
 437                          }
 438                  }
 439   
 440                  master_fd = master_connect(group_name);
 441          }
 442   
 443          drop_privileges(&max_fds);
 444   
 445          if (argv[1] != NULL && strcmp(argv[1], "-D") == 0)
 446                  restrict_access_allow_coredumps(TRUE);
 447   
 448          process_title_init(argv, envp);
 449          ioloop = io_loop_create();
 450          io_loop_set_max_fd_count(ioloop, max_fds);
 451          main_init();
 452   
 453          if (is_inetd) {
 454[+]                 if (net_getpeername(1, &remote_ip, &remote_port) < 0) {
 455                          i_fatal("%s can be started only through dovecot "
 456                                  "master process, inetd or equivalent", argv[0]);
 457                  }
 458[+]                 if (net_getsockname(1, &local_ip, &local_port) < 0) {
 459                          memset(&local_ip, 0, sizeof(local_ip));
 460                          local_port = 0;
 461                  }
 462   
 463                  fd = 1;
 464                  for (i = 1; i < argc; i++) {
 465                          if (strcmp(argv[i], "--ssl") == 0)
 466                                  ssl = TRUE;
 467                          else if (strncmp(argv[i], "--group=", 8) != 0)
 468                                  i_fatal("Unknown parameter: %s", argv[i]);
 469                  }
 470   
 471                  /* hardcoded imaps and pop3s ports to be SSL by default */
 472                  if (local_port == 993 || local_port == 995 || ssl) {
 473                          ssl = TRUE;
 474                          fd = ssl_proxy_new(fd, &remote_ip, &proxy);
 475                          if (fd == -1)
 476                                  return 1;
 477                  }
 478   
 479                  master_init(master_fd);
 480                  closing_down = TRUE;
 481   
 482                  if (fd != -1) {
 483[+]                         client = client_create(fd, ssl, &local_ip, &remote_ip);
expand/collapse

client_create

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/pop3/client.c)expand/collapse
Show more  
 155  struct client *client_create(int fd_in, int fd_out, struct mail_user *user)
 156  {
 157          struct mail_storage *storage;
 158          const char *inbox;
 159          struct client *client;
 160          enum mailbox_open_flags flags;
 161          const char *errmsg;
 162          enum mail_error error;
 163   
 164          /* always use nonblocking I/O */
 165          net_set_nonblock(fd_in, TRUE);
 166          net_set_nonblock(fd_out, TRUE);
 167   
 168          client = i_new(struct client, 1);
 169          client->fd_in = fd_in;
 170          client->fd_out = fd_out;
 171          client->input = i_stream_create_fd(fd_in, MAX_INBUF_SIZE, FALSE);
 172          client->output = o_stream_create_fd(fd_out, (size_t)-1, FALSE);
 173          o_stream_set_flush_callback(client->output, client_output, client);
 174   
 175          client->io = io_add(fd_in, IO_READ, client_input, client);
 176          client->last_input = ioloop_time;
 177          client->to_idle = timeout_add(CLIENT_IDLE_TIMEOUT_MSECS,
 178                                        client_idle_timeout, client);
 179          if (!lock_session) {
 180                  client->to_commit = timeout_add(CLIENT_COMMIT_TIMEOUT_MSECS,
 181                                                  client_commit_timeout, client);
 182          }
 183   
 184          client->user = user;
 185   
 186          inbox = "INBOX";
 187          client->inbox_ns = mail_namespace_find(user->namespaces, &inbox);
Show more  
Show more  




Change Warning 12158.25830 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: