Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at password-scheme.c:178

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

auth_request_password_verify

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/auth-request.c)expand/collapse
Show more  
 1275  int auth_request_password_verify(struct auth_request *request,
 1276                                   const char *plain_password,
 1277                                   const char *crypted_password,
 1278                                   const char *scheme, const char *subsystem)
 1279  {
 1280          const unsigned char *raw_password;
 1281          size_t raw_password_size;
 1282          int ret;
 1283   
 1284          if (request->skip_password_check) {
 1285                  /* currently this can happen only with master logins */
 1286                  i_assert(request->master_user != NULL);
 1287                  return 1;
 1288          }
 1289   
 1290          if (request->passdb->deny) {
 1291                  /* this is a deny database, we don't care about the password */
 1292                  return 0;
 1293          }
 1294   
 1295          if (request->no_password) {
 1296                  auth_request_log_info(request, subsystem, "No password");
 1297                  return 1;
 1298          }
 1299   
 1300          ret = password_decode(crypted_password, scheme,
 1301[+]                               &raw_password, &raw_password_size);
expand/collapse

password_decode

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/password-scheme.c)expand/collapse
Show more  
 129  int password_decode(const char *password, const char *scheme,
 130                      const unsigned char **raw_password_r, size_t *size_r)
 131  {
 132          const struct password_scheme *s;
 133          enum password_encoding encoding;
 134          buffer_t *buf;
 135          unsigned int len;
 136   
 137[+]         s = password_scheme_lookup(scheme, &encoding);
 138          if (s == NULL)
 139                  return 0;
 140   
 141          len = strlen(password);
 142          if (encoding != PW_ENCODING_NONE && s->raw_password_len != 0 &&
 143              strchr(scheme, '.') == NULL) {
 144                  /* encoding not specified. we can guess quite well between
 145                     base64 and hex encodings. the only problem is distinguishing 
 146                     2 character strings, but there shouldn't be any that short
 147                     raw_password_lens. */
 148                  encoding = len == s->raw_password_len * 2 ? PW_ENCODING_HEX :
 149                          PW_ENCODING_BASE64;
 150          }
 151   
 152          switch (encoding) {
 153          case PW_ENCODING_NONE:
 154                  *raw_password_r = (const unsigned char *)password;
 155                  *size_r = len;
 156                  break;
 157          case PW_ENCODING_HEX:
 158                  buf = buffer_create_static_hard(pool_datastack_create(),
 159                                                  len / 2 + 1);
 160                  if (hex_to_binary(password, buf) == 0) {
 161                          *raw_password_r = buf->data;
 162                          *size_r = buf->used;
 163                          break;
 164                  }
 165                  /* fall through, just in case it was base64-encoded after 
 166                     all. some input lengths produce matching hex and base64
 167                     encoded lengths. */
 168          case PW_ENCODING_BASE64:
 169                  buf = buffer_create_static_hard(pool_datastack_create(),
 170                                                  MAX_BASE64_DECODED_SIZE(len));
 171                  if (base64_decode(password, len, NULL, buf) < 0)
 172                          return -1;
 173   
 174                  *raw_password_r = buf->data;
 175                  *size_r = buf->used;
 176                  break;
 177          }
 178          if (s->raw_password_len != *size_r && s->raw_password_len != 0) {
Show more  
Show more  




Change Warning 7578.24782 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: