Text   |  XML   |  ReML   |   Visible Warnings:

Free Null Pointer  at dict-server.c:502

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

dict_client_connection_input

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/dict/dict-server.c)expand/collapse
Show more  
 417  static void dict_client_connection_input(struct dict_client_connection *conn)
 418  {
 419          const char *line;
 420          unsigned int i;
 421          int ret;
 422   
 423[+]         switch (i_stream_read(conn->input)) {
 424          case 0:
 425                  return;
 426          case -1:
 427                  /* disconnected */
 428                  dict_client_connection_deinit(conn);
 429                  return;
 430          case -2:
 431                  /* buffer full */
 432                  i_error("dict client: Sent us more than %d bytes",
 433                          (int)DICT_CLIENT_MAX_LINE_LENGTH);
 434                  dict_client_connection_deinit(conn);
 435                  return;
 436          }
 437   
 438          if (conn->username == NULL) {
 439                  /* handshake not received yet */
 440[+]                 if ((line = i_stream_next_line(conn->input)) == NULL)
 441                          return;
 442   
 443[+]                 if (dict_client_parse_handshake(conn, line) < 0) {
 444                          i_error("dict client: Broken handshake");
 445[+]                         dict_client_connection_deinit(conn);
expand/collapse

dict_client_connection_deinit

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/dict/dict-server.c)expand/collapse
Show more  
 471  static void dict_client_connection_deinit(struct dict_client_connection *conn)
 472  {
 473          struct dict_server_transaction *transactions;
 474          unsigned int i, count;
 475   
 476          if (conn->prev == NULL)
 477                  conn->server->connections = conn->next;
 478          else 
 479                  conn->prev->next = conn->next;
 480          if (conn->next != NULL)
 481                  conn->next->prev = conn->prev;
 482   
 483[+]         if (array_is_created(&conn->transactions)) {
 484                  transactions = array_get_modifiable(&conn->transactions, &count);
 485                  for (i = 0; i < count; i++)
 486                          dict_transaction_rollback(&transactions[i].ctx);
 487                  array_free(&conn->transactions);
 488          }
 489   
 490          if (conn->iter_ctx != NULL)
 491                  dict_iterate_deinit(&conn->iter_ctx);
 492   
 493          io_remove(&conn->io);
 494          i_stream_destroy(&conn->input);
 495          o_stream_destroy(&conn->output);
 496          if (close(conn->fd) < 0)
 497                  i_error("close(dict client) failed: %m");
 498   
 499          if (conn->dict != NULL)
 500                  dict_deinit(&conn->dict);
 501          i_free(conn->name);
 502          i_free(conn->username);
Show more  
Show more  




Change Warning 11736.24707 : Free Null Pointer

Priority:
State:
Finding:
Owner:
Note: