Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at auth-request.c:846

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

mech_plain_auth_continue

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/mech-plain.c)expand/collapse
Show more  
 10  mech_plain_auth_continue(struct auth_request *request,
 11                           const unsigned char *data, size_t data_size)
 12  {
 13          const char *authid, *authenid, *error;
 14          char *pass;
 15          size_t i, len;
 16          int count;
 17   
 18          /* authorization ID \0 authentication ID \0 pass.
 19             we'll ignore authorization ID for now. */
 20          authid = (const char *) data;
 21          authenid = NULL; pass = NULL;
 22   
 23          count = 0;
 24          for (i = 0; i < data_size; i++) {
 25                  if (data[i] == '\0') {
 26                          if (++count == 1)
 27                                  authenid = (const char *) data + i+1;
 28                          else {
 29                                  i++;
 30                                  len = data_size - i;
 31                                  pass = p_strndup(unsafe_data_stack_pool,
 32                                                   data+i, len);
 33                                  break;
 34                          }
 35                  }
 36          }
 37   
 38          if (authenid != NULL && strcmp(authid, authenid) == 0) {
 39                  /* the  username isn't different */
 40                  authid = "";
 41          }
 42   
 43          if (count != 2) {
 44                  /* invalid input */
 45                  auth_request_log_info(request, "plain", "invalid input");
 46                  auth_request_fail(request);
 47[+]         } else if (!auth_request_set_username(request, authenid, &error)) {
expand/collapse

auth_request_set_username

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/auth-request.c)expand/collapse
Show more  
 812  bool auth_request_set_username(struct auth_request *request,
 813                                 const char *username, const char **error_r)
 814  {
 815          const char *p, * = NULL;
 816   
 817          if (request->auth->master_user_separator != '\0' &&
 818              !request->userdb_lookup) {
 819                  /* check if the username contains a master user */
 820                  p = strchr(username, request->auth->master_user_separator);
 821                  if (p != NULL) {
 822                          /* it does, set it. */
 823                           = t_strdup_until(username, p);
 824   
 825                          if (* == '\0') {
 826                                  *error_r = "Empty  username";
 827                                  return FALSE;
 828                          }
 829   
 830                          /* username is the master user */
 831                          username = p + 1;
 832                  }
 833          }
 834   
 835          if (request->original_username == NULL) {
 836                  /* the username may change later, but we need to use this
 837                     username when verifying at least DIGEST-MD5 password. */
 838                  request->original_username = p_strdup(request->pool, username);
 839          }
 840          if (request->cert_username) {
 841                  /* cert_username overrides the username given by
 842                     authentication mechanism. */
 843                  return TRUE;
 844          }
 845   
 846          if (*username == '\0') {
Show more  
Show more  




Change Warning 7613.25594 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: