Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at mbox-storage.c:893

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

mbox_list_iter_is_mailbox

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/mbox/mbox-storage.c)expand/collapse
Show more  
 848  static int mbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
 849                                       const char *dir, const char *fname,
 850                                       const char *mailbox_name ATTR_UNUSED,
 851                                       enum mailbox_list_file_type type,
 852                                       enum mailbox_info_flags *flags)
 853  {
 854          struct mail_storage *storage = MBOX_LIST_CONTEXT(ctx->list);
 855          const char *path, *root_dir;
 856          size_t len;
 857          struct stat st;
 858   
 859          if (strcmp(fname, MBOX_INDEX_DIR_NAME) == 0) {
 860                  *flags |= MAILBOX_NOSELECT;
 861                  return 0;
 862          }
 863          if (strcmp(fname, ctx->list->set.subscription_fname) == 0) {
 864                  root_dir = mailbox_list_get_path(storage->list, NULL,
 865                                                   MAILBOX_LIST_PATH_TYPE_DIR);
 866                  if (strcmp(root_dir, dir) == 0) {
 867                          *flags |= MAILBOX_NOSELECT | MAILBOX_NOINFERIORS;
 868                          return 0;
 869                  }
 870          }
 871   
 872          /* skip all .lock files */
 873          len = strlen(fname);
 874          if (len > 5 && strcmp(fname+len-5, ".lock") == 0) {
 875                  *flags |= MAILBOX_NOSELECT | MAILBOX_NOINFERIORS;
 876                  return 0;
 877          }
 878   
 879          /* try to avoid stat() with these checks */
 880          if (type == MAILBOX_LIST_FILE_TYPE_DIR) {
 881                  *flags |= MAILBOX_NOSELECT | MAILBOX_CHILDREN;
 882                  return 1;
 883          }
 884          if (type != MAILBOX_LIST_FILE_TYPE_SYMLINK &&
 885              type != MAILBOX_LIST_FILE_TYPE_UNKNOWN &&
 886              (ctx->flags & MAILBOX_LIST_ITER_RETURN_NO_FLAGS) != 0) {
 887                  *flags |= MAILBOX_NOINFERIORS;
 888                  return 1;
 889          }
 890   
 891          /* need to stat() then */
 892[+]         path = t_strconcat(dir, "/", fname, NULL);
 893          if (stat(path, &st) == 0) {
Show more  




Change Warning 7438.24670 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: