Text   |  XML   |  ReML   |   Visible Warnings:

Use After Free  at auth-client-connection.c:341

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

auth_client_input

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/auth-client-connection.c)expand/collapse
Show more  
 192  static void auth_client_input(struct auth_client_connection *conn)
 193  {
 194          char *line;
 195          bool ret;
 196   
 197[+]         switch (i_stream_read(conn->input)) {
 198          case 0:
 199                  return;
 200          case -1:
 201                  /* disconnected */
 202                  auth_client_connection_destroy(&conn);
 203                  return;
 204          case -2:
 205                  /* buffer full */
 206                  i_error("BUG: Auth client %u sent us more than %d bytes",
 207                          conn->pid, (int)AUTH_CLIENT_MAX_LINE_LENGTH);
 208                  auth_client_connection_destroy(&conn);
 209                  return;
 210          }
 211   
 212          while (conn->request_handler == NULL) {
 213                  /* still handshaking */
 214                  line = i_stream_next_line(conn->input);
 215                  if (line == NULL)
 216                          return;
 217   
 218                  if (!conn->version_received) {
 219                          /* make sure the major version matches */
 220                          if (strncmp(line, "VERSION\t", 8) != 0 ||
 221                              atoi(t_strcut(line + 8, '\t')) !=
 222                              AUTH_CLIENT_PROTOCOL_MAJOR_VERSION) {
 223
236
Show [ Lines 223 to 236 omitted. ]
 237                          }
 238                  } else {
 239                          i_error("BUG: Authentication client sent "
 240                                  "unknown handshake command: %s",
 241                                  str_sanitize(line, 80));
 242                          auth_client_connection_destroy(&conn);
 243                          return;
 244                  }
 245          }
 246   
 247          conn->refcount++;
 248          while ((line = i_stream_next_line(conn->input)) != NULL) {
 249                  T_BEGIN {
 250                          ret = auth_client_handle_line(conn, line);
 251                          safe_memset(line, 0, strlen(line));
 252                  } T_END;
 253   
 254                  if (!ret) {
 255                          struct auth_client_connection *tmp_conn = conn;
 256[+]                         auth_client_connection_destroy(&tmp_conn);
 257                          break;
 258                  }
 259          }
 260[+]         auth_client_connection_unref(&conn);
expand/collapse

auth_client_connection_unref

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/auth-client-connection.c)expand/collapse
Show more  
 336  static void auth_client_connection_unref(struct auth_client_connection **_conn)
 337  {
 338          struct auth_client_connection *conn = *_conn;
 339   
 340          *_conn = NULL;
 341          if (--conn->refcount > 0)
Show more  
Show more  




Change Warning 11574.24959 : Use After Free

Priority:
State:
Finding:
Owner:
Note: