Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at maildir-storage.c:985

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

maildir_list_iter_is_mailbox

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-storage.c)expand/collapse
Show more  
 920  maildir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx
 921                                  ATTR_UNUSED,
 922                               const char *dir, const char *fname,
 923                               const char *mailbox_name ATTR_UNUSED,
 924                               enum mailbox_list_file_type type,
 925                               enum mailbox_info_flags *flags)
 926  {
 927          struct stat st, st2;
 928          const char *path, *cur_path;
 929   
 930[+]         if (maildir_is_internal_name(fname)) {
 931                  *flags |= MAILBOX_NONEXISTENT;
 932                  return 0;
 933          }
 934   
 935          switch (type) {
 936          case MAILBOX_LIST_FILE_TYPE_FILE:
 937          case MAILBOX_LIST_FILE_TYPE_OTHER:
 938                  /* non-directories are not */
 939                  *flags |= MAILBOX_NOSELECT;
 940                  return 0;
 941   
 942          case MAILBOX_LIST_FILE_TYPE_DIR:
 943          case MAILBOX_LIST_FILE_TYPE_UNKNOWN:
 944          case MAILBOX_LIST_FILE_TYPE_SYMLINK:
 945                  break;
 946          }
 947   
 948          path = t_strdup_printf("%s/%s", dir, fname);
 949          if (stat(path, &st) == 0) {
 950                  if (!S_ISDIR(st.st_mode)) {
 951                          if (strncmp(fname, ".nfs", 4) == 0) {
 952                                  /* temporary NFS file */
 953                                  *flags |= MAILBOX_NONEXISTENT;
 954                          } else {
 955                                  *flags |= MAILBOX_NOSELECT |
 956                                          MAILBOX_NOINFERIORS;
 957                          }
 958                          return 0;
 959                  }
 960          } else if (errno == ENOENT) {
 961                  /* doesn't exist - probably a non-existing subscribed mailbox */
 962                  *flags |= MAILBOX_NONEXISTENT;
 963          } else {
 964                  /* non-selectable. probably either access denied, or symlink
 965                     destination not found. don't bother logging errors. */
 966                  *flags |= MAILBOX_NOSELECT;
 967          }
 968          if ((*flags & (MAILBOX_NOSELECT | MAILBOX_NONEXISTENT)) == 0) {
 969                  /* make sure it's a selectable mailbox */
 970                  cur_path = t_strconcat(path, "/cur", NULL);
 971                  if (stat(cur_path, &st2) < 0 || !S_ISDIR(st2.st_mode))
 972                          *flags |= MAILBOX_NOSELECT;
 973   
 974                  if (*ctx->list->set.maildir_name == '\0') {
 975                          /* now we can figure out based on the link count if we
 976                             have child mailboxes or not. for a selectable 
 977                             mailbox we have 3 more links (cur/, new/ and tmp/)
 978                             than non-selectable. */
 979                          if ((*flags & MAILBOX_NOSELECT) == 0) {
 980                                  if (st.st_nlink > 5)
 981                                          *flags |= MAILBOX_CHILDREN;
 982                                  else 
 983                                          *flags |= MAILBOX_NOCHILDREN;
 984                          } else {
 985                                  if (st.st_nlink > 2)
Show more  




Change Warning 7389.24820 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: