Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at mailbox-list-fs-iter.c:155

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

list_file_subdir

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/list/mailbox-list-fs-iter.c)expand/collapse
Show more  
 483  list_file_subdir(struct fs_list_iterate_context *ctx,
 484                   enum imap_match_result match, const char *list_path,
 485                   const char *fname)
 486  {
 487          struct list_dir_context *dir;
 488          DIR *dirp;
 489          enum imap_match_result match2;
 490          const char *vpath, *real_path;
 491          bool scan_subdir, delayed_send = FALSE;
 492          int ret;
 493   
 494          vpath = t_strdup_printf("%s%c", list_path, ctx->sep);
 495          match2 = imap_match(ctx->glob, vpath);
 496   
 497          if (match == IMAP_MATCH_YES)
 498                  ctx->info.name = p_strdup(ctx->info_pool, list_path);
 499          else if (match2 == IMAP_MATCH_YES)
 500                  ctx->info.name = p_strdup(ctx->info_pool, vpath);
 501          else 
 502                  ctx->info.name = NULL;
 503   
 504          scan_subdir = (match2 & (IMAP_MATCH_YES | IMAP_MATCH_CHILDREN)) != 0;
 505          if ((match == IMAP_MATCH_YES || scan_subdir) &&
 506              ctx->info.name != NULL &&
 507              (ctx->ctx.flags & MAILBOX_LIST_ITER_RETURN_CHILDREN) != 0 &&
 508              (ctx->info.flags & (MAILBOX_CHILDREN | MAILBOX_NOCHILDREN)) == 0) {
 509                  scan_subdir = TRUE;
 510                  delayed_send = TRUE;
 511          }
 512   
 513          if (scan_subdir) {
 514[+]                 real_path = t_strconcat(ctx->dir->real_path, "/", fname, NULL);
 515[+]                 ret = list_opendir(ctx, real_path, vpath, &dirp);
expand/collapse

list_opendir

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/list/mailbox-list-fs-iter.c)expand/collapse
Show more  
 133  static int list_opendir(struct fs_list_iterate_context *ctx,
 134                          const char *path, const char *list_path, DIR **dirp)
 135  {
 136          char *const *patterns;
 137          unsigned int i;
 138   
 139          /* if no patterns have wildcards at this point of the path, we don't
 140             have to readdir() the files. instead we can just go through the 
 141             mailboxes listed in patterns. */
 142          T_BEGIN {
 143                  patterns = array_idx(&ctx->valid_patterns, 0);
 144                  for (i = 0; patterns[i] != NULL; i++) {
 145                          if (pattern_has_wildcard_at(ctx, patterns[i],
 146                                                      list_path))
 147                                  break;
 148                  }
 149          } T_END;
 150          if (patterns[i] == NULL) {
 151                  *dirp = NULL;
 152                  return 1;
 153          }
 154   
 155          *dirp = opendir(*path == '\0' ? "/" : path);
Show more  
Show more  




Change Warning 7284.24970 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: