Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at dbox-storage.c:666

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

dbox_list_iter_is_mailbox

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/dbox/dbox-storage.c)expand/collapse
Show more  
 610  static int dbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx
 611                                                          ATTR_UNUSED,
 612                                       const char *dir, const char *fname,
 613                                       const char *mailbox_name ATTR_UNUSED,
 614                                       enum mailbox_list_file_type type,
 615                                       enum mailbox_info_flags *flags)
 616  {
 617          const char *path, *maildir_path;
 618          struct stat st, st2;
 619          int ret = 1;
 620   
 621          /* try to avoid stat() with these checks */
 622          if (type != MAILBOX_LIST_FILE_TYPE_DIR &&
 623              type != MAILBOX_LIST_FILE_TYPE_SYMLINK &&
 624              type != MAILBOX_LIST_FILE_TYPE_UNKNOWN) {
 625                  /* it's a file */
 626                  *flags |= MAILBOX_NOSELECT | MAILBOX_NOINFERIORS;
 627                  return 0;
 628          }
 629   
 630          /* need to stat() then */
 631          path = t_strconcat(dir, "/", fname, NULL);
 632          if (stat(path, &st) == 0) {
 633                  if (!S_ISDIR(st.st_mode)) {
 634                          /* non-directory */
 635                          *flags |= MAILBOX_NOSELECT | MAILBOX_NOINFERIORS;
 636                          ret = 0;
 637                  } else if (st.st_nlink == 2) {
 638                          /* no subdirectories */
 639                          *flags |= MAILBOX_NOCHILDREN;
 640                  } else if (*ctx->list->set.maildir_name != '\0') {
 641                          /* default configuration: we have one directory
 642                             containing the mailboxes. if there are 3 links,
 643                             either this is a selectable mailbox without children 
 644                             or non-selectable mailbox with children */
 645                          if (st.st_nlink > 3)
 646                                  *flags |= MAILBOX_CHILDREN;
 647                  } else {
 648                          /* non-default configuration: all subdirectories are 
 649                             child mailboxes. */
 650                          if (st.st_nlink > 2)
 651                                  *flags |= MAILBOX_CHILDREN;
 652                  }
 653          } else if (errno == ENOENT) {
 654                  /* doesn't exist - probably a non-existing subscribed mailbox */
 655                  *flags |= MAILBOX_NONEXISTENT;
 656          } else {
 657                  /* non-selectable. probably either access denied, or symlink
 658                     destination not found. don't bother logging errors. */
 659                  *flags |= MAILBOX_NOSELECT;
 660          }
 661          if ((*flags & (MAILBOX_NOSELECT | MAILBOX_NONEXISTENT)) == 0) {
 662                  /* make sure it's a selectable mailbox */
 663                  maildir_path = t_strconcat(path, "/"DBOX_MAILDIR_NAME, NULL);
 664                  if (stat(maildir_path, &st2) < 0 || !S_ISDIR(st2.st_mode))
 665                          *flags |= MAILBOX_NOSELECT;
 666                  if (st.st_nlink == 3 && *ctx->list->set.maildir_name != '\0') {
Show more  




Change Warning 7486.24672 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: