Text   |  XML   |  ReML   |   Visible Warnings:

Free Null Pointer  at pop3-proxy.c:33

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

proxy_input_line

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/pop3-login/pop3-proxy.c)expand/collapse
Show more  
 70  static int proxy_input_line(struct pop3_client *client, const char *line)
 71  {
 72          struct ostream *output;
 73          enum  ssl_flags;
 74          string_t *str;
 75   
 76          i_assert(!client->destroyed);
 77   
 78          output = (client->proxy);
 79          switch (client->proxy_state) {
 80          case POP3_PROXY_BANNER:
 81                  /* this is a banner */
 82                  if (strncmp(line, "+OK", 3) != 0) {
 83                          client_syslog_err(&client->common, t_strdup_printf(
 84                                  "proxy: Remote returned invalid banner: %s",
 85                                  str_sanitize(line, 160)));
 86                          proxy_failed(client, TRUE);
 87                          return -1;
 88                  }
 89   
 90
174
Show [ Lines 90 to 174 omitted. ]
 175             system.
 176   
 177             The optimal way to handle this would be to replace the
 178             backend's "password failed" error message with Dovecot's
 179             AUTH_FAILED_MSG, but this would require a new setting and
 180             the sysadmin to actually bother setting it properly.
 181   
 182             So for now we'll just forward the error message. This 
 183             shouldn't be a real problem since of course everyone will 
 184             be using only Dovecot as their backend :) */
 185          if (strncmp(line, "-ERR ", 5) != 0)
 186                  client_send_line(client, "-ERR "AUTH_FAILED_MSG);
 187          else 
 188                  client_send_line(client, line);
 189   
 190          if (verbose_auth) {
 191                  str = t_str_new(128);
 192                  str_printfa(str, "proxy(%s):  failed to %s:%u",
 193                              client->common.virtual_user,
 194                              (client->proxy),
 195                              (client->proxy));
 196                  if (strcmp(client->common.virtual_user,
 197                             client->proxy_user) != 0) {
 198                          /* remote username is different, log it */
 199                          str_append_c(str, '/');
 200                          str_append(str, client->proxy_user);
 201                  }
 202                  if (client->proxy_master_user != NULL) {
 203                          str_printfa(str, " (master %s)",
 204                                      client->proxy_master_user);
 205                  }
 206                  str_append(str, ": ");
 207                  if (strncmp(line, "-ERR ", 5) == 0)
 208                          str_append(str, line + 5);
 209                  else 
 210                          str_append(str, line);
 211                  i_info("%s", str_c(str));
 212          }
 213[+]         proxy_failed(client, FALSE);
expand/collapse

proxy_failed

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/pop3-login/pop3-proxy.c)expand/collapse
Show more  
 25  static void proxy_failed(struct pop3_client *client, bool send_line)
 26  {
 27          if (send_line)
 28                  client_send_line(client, PROXY_FAILURE_MSG);
 29   
 30          (&client->proxy);
 31          proxy_free_password(client);
 32          i_free_and_null(client->proxy_user);
 33          i_free_and_null(client->proxy_master_user);
Show more  
Show more  




Change Warning 11778.25871 : Free Null Pointer

Because they are very similar, this warning shares annotations with warning 11778.25980.

Priority:
State:
Finding:
Owner:
Note: