Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Underrun  at base64.c:93

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

main_init

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/imap/main.c)expand/collapse
Show more  
 168  static void main_init(void)
 169  {
 170          struct client *client;
 171          struct ostream *output;
 172          struct mail_user *user;
 173          const char *username, *home, *str, *tag;
 174   
 175          lib_signals_init();
 176          lib_signals_set_handler(SIGINT, TRUE, sig_die, NULL);
 177          lib_signals_set_handler(SIGTERM, TRUE, sig_die, NULL);
 178          lib_signals_ignore(SIGPIPE, TRUE);
 179          lib_signals_ignore(SIGALRM, FALSE);
 180   
 181          username = getenv("USER");
 182          if (username == NULL) {
 183                  if (IS_STANDALONE())
 184                          username = getlogin();
 185                  if (username == NULL)
 186                          i_fatal("USER environment missing");
 187          }
 188   
 189          home = getenv("HOME");
 190          if (getenv("DEBUG") != NULL) {
 191                  i_info("Effective uid=%s, gid=%s, home=%s",
 192                         dec2str(geteuid()), dec2str(getegid()),
 193                         home != NULL ? home : "(none)");
 194          }
 195   
 196          if (getenv("STDERR_CLOSE_SHUTDOWN") != NULL) {
 197                  /* If master dies, the log fd gets closed and we'll quit */
 198                  log_io = io_add(STDERR_FILENO, IO_ERROR,
 199                                  log_error_callback, NULL);
 200          }
 201   
 202          capability_string = str_new(default_pool, sizeof(CAPABILITY_STRING)+32);
 203          str_append(capability_string, CAPABILITY_STRING);
 204   
 205          dict_drivers_register_builtin();
 206          mail_users_init(getenv("AUTH_SOCKET_PATH"), getenv("DEBUG") != NULL);
 207          mail_storage_init();
 208          mail_storage_register_all();
 209          mailbox_list_register_all();
 210          clients_init();
 211          commands_init();
 212          imap_fetch_handlers_init();
 213   
 214          module_dir_init(modules);
 215   
 216          if (getenv("DUMP_CAPABILITY") != NULL) {
 217                  printf("%s\n", str_c(capability_string));
 218                  exit(0);
 219          }
 220   
 221          str = getenv("IMAP_CAPABILITY");
 222          if (str != NULL && *str != '\0') {
 223                  /* Overrides all capabilities */
 224                  str_truncate(capability_string, 0);
 225                  str_append(capability_string, str);
 226          }
 227   
 228          str = getenv("IMAP_MAX_LINE_LENGTH");
 229          imap_max_line_length = str != NULL ?
 230                  (unsigned int)strtoul(str, NULL, 10) :
 231                  DEFAULT_IMAP_MAX_LINE_LENGTH;
 232   
 233          logout_format = getenv("IMAP_LOGOUT_FORMAT");
 234          if (logout_format == NULL)
 235                  logout_format = "bytes=%i/%o";
 236   
 237          imap_id_send = getenv("IMAP_ID_SEND");
 238          imap_id_log = getenv("IMAP_ID_LOG");
 239   
 240          parse_workarounds();
 241   
 242          user = mail_user_init(username);
 243          mail_user_set_home(user, home);
 244[+]         if (mail_namespaces_init(user) < 0)
 245                  i_fatal("Namespace initialization failed");
 246          client = client_create(0, 1, user);
 247   
 248          output = client->output;
 249          o_stream_ref(output);
 250          o_stream_cork(output);
 251   
 252          /* IMAPLOGINTAG environment is compatible with mailfront */
 253          tag = getenv("IMAPLOGINTAG");
 254          if (tag == NULL) {
 255                  client_send_line(client, t_strconcat(
 256                          "* PREAUTH [CAPABILITY ",
 257                          str_c(capability_string), "] "
 258                          "Logged in as ", user->username, NULL));
 259          } else {
 260                  client_send_line(client, t_strconcat(
 261                          tag, " OK [CAPABILITY ",
 262                          str_c(capability_string), "] Logged in", NULL));
 263          }
 264          str = getenv("CLIENT_INPUT");
 265          if (str != NULL) T_BEGIN {
 266[+]                 buffer_t *buf = t_base64_decode_str(str);
expand/collapse

t_base64_decode_str

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/base64.c)expand/collapse
Show more  
 152  buffer_t *t_base64_decode_str(const char *str)
 153  {
 154          buffer_t *buf;
 155          size_t len = strlen(str);
 156   
 157          buf = buffer_create_dynamic(pool_datastack_create(),
 158                                      MAX_BASE64_DECODED_SIZE(len));
 159[+]         (void)base64_decode(str, len, NULL, buf);
expand/collapse

base64_decode

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/base64.c)expand/collapse
Show more  
 84  int base64_decode(const void *src, size_t src_size,
 85                    size_t *src_pos_r, buffer_t *dest)
 86  {
 87          const unsigned char *src_c = src;
 88          size_t src_pos;
 89          unsigned char input[4], output[3];
 90          int ret = 1;
 91   
 92          for (src_pos = 0; src_pos+3 < src_size; ) {
 93                  input[0] = b64dec[src_c[src_pos]];
Show more  
Show more  
Show more  




Change Warning 7994.25745 : Buffer Underrun

Priority:
State:
Finding:
Owner:
Note: