Text   |  XML   |  ReML   |   Visible Warnings:

Type Underrun  at auth.c:273

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

auth_init

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/auth.c)expand/collapse
Show more  
 206  void auth_init(struct auth *auth)
 207  {
 208          struct auth_passdb *passdb;
 209          struct auth_userdb *userdb;
 210          const struct mech_module *mech;
 211          const char *const *mechanisms;
 212          const char *env;
 213   
 214          for (passdb = auth->masterdbs; passdb != NULL; passdb = passdb->next)
 215                  passdb_init(passdb);
 216          for (passdb = auth->passdbs; passdb != NULL; passdb = passdb->next)
 217                  passdb_init(passdb);
 218          for (userdb = auth->userdbs; userdb != NULL; userdb = userdb->next)
 219                  userdb_init(userdb);
 220          /* caching is handled only by the main auth process */
 221          if (!worker)
 222                  passdb_cache_init();
 223   
 224          auth->mech_handshake = str_new(auth->pool, 512);
 225   
 226          auth->anonymous_username = getenv("ANONYMOUS_USERNAME");
 227          if (auth->anonymous_username != NULL &&
 228              *auth->anonymous_username == '\0')
 229                  auth->anonymous_username = NULL;
 230   
 231          /* register wanted mechanisms */
 232          env = getenv("MECHANISMS");
 233          if (env == NULL)
 234                  i_fatal("MECHANISMS environment is unset");
 235   
 236          mechanisms = t_strsplit_spaces(env, " ");
 237          while (*mechanisms != NULL) {
 238                  if (strcasecmp(*mechanisms, "ANONYMOUS") == 0) {
 239                          if (auth->anonymous_username == NULL) {
 240                                  i_fatal("ANONYMOUS listed in mechanisms, "
 241                                          "but anonymous_username not given");
 242                          }
 243                  }
 244                  mech = mech_module_find(*mechanisms);
 245                  if (mech == NULL) {
 246                          i_fatal("Unknown authentication mechanism '%s'",
 247                                  *mechanisms);
 248                  }
 249                  auth_mech_register(auth, mech);
 250   
 251                  mechanisms++;
 252          }
 253   
 254          if (auth->mech_modules == NULL)
 255                  i_fatal("No authentication mechanisms configured");
 256          auth_mech_list_verify_passdb(auth);
 257   
 258          env = getenv("REALMS");
 259          if (env == NULL)
 260                  env = "";
 261          auth->auth_realms = p_strsplit_spaces(auth->pool, env, " ");
 262   
 263          env = getenv("DEFAULT_REALM");
 264          if (env != NULL && *env != '\0')
 265                  auth->default_realm = env;
 266   
 267          env = getenv("USERNAME_CHARS");
 268          if (env == NULL || *env == '\0') {
 269                  /* all chars are allowed */
 270                  memset(auth->username_chars, 1, sizeof(auth->username_chars));
 271          } else {
 272                  for (; *env != '\0'; env++)
 273                          auth->username_chars[(int)(uint8_t)*env] = 1;
Show more  




Change Warning 7565.25547 : Type Underrun

Priority:
State:
Finding:
Owner:
Note: