Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at imap-match.c:291

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

shared_list_iter_next

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/shared/shared-list.c)expand/collapse
Show more  
 174  static const struct mailbox_info *
 175  shared_list_iter_next(struct mailbox_list_iterate_context *_ctx)
 176  {
 177          struct shared_mailbox_list_iterate_context *ctx =
 178                  (struct shared_mailbox_list_iterate_context *)_ctx;
 179          struct mail_namespace *ns = ctx->cur_ns;
 180   
 181          for (; ns != NULL; ns = ns->next) {
 182                  if (ns->type != NAMESPACE_SHARED ||
 183                      (ns->flags & NAMESPACE_FLAG_AUTOCREATED) == 0)
 184                          continue;
 185                  if ((ns->flags & (NAMESPACE_FLAG_LIST_PREFIX |
 186                                    NAMESPACE_FLAG_LIST_CHILDREN)) == 0)
 187                          continue;
 188   
 189                  if (ns->prefix_len < ctx->info.ns->prefix_len ||
 190                      strncmp(ns->prefix, ctx->info.ns->prefix,
 191                              ctx->info.ns->prefix_len) != 0)
 192                          continue;
 193   
 194                  /* visible and listable namespace under ourself, see if the 
 195                     prefix matches without the trailing separator */
 196                  i_assert(ns->prefix_len > 0);
 197[+]                 ctx->info.name = t_strndup(ns->prefix, ns->prefix_len - 1);
 198                  if ((_ctx->flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) == 0)
 199                          ctx->info.name += ctx->info.ns->prefix_len;
 200[+]                 if (imap_match(ctx->glob, ctx->info.name) == IMAP_MATCH_YES) {
expand/collapse

imap_match

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-imap/imap-match.c)expand/collapse
Show more  
 308  imap_match(struct imap_match_glob *glob, const char *data)
 309  {
 310          struct imap_match_context ctx;
 311          unsigned int i;
 312          enum imap_match_result ret, match;
 313   
 314          match = IMAP_MATCH_NO;
 315          ctx.sep = glob->sep;
 316          for (i = 0; glob->patterns[i].pattern != NULL; i++) {
 317                  ctx.inboxcase = glob->patterns[i].inboxcase;
 318   
 319[+]                 ret = imap_match_pattern(&ctx, data, glob->patterns[i].pattern);
expand/collapse

imap_match_pattern

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-imap/imap-match.c)expand/collapse
Show more  
 264  imap_match_pattern(struct imap_match_context *ctx,
 265                     const char *data, const char *pattern)
 266  {
 267          enum imap_match_result ret, match;
 268   
 269          ctx->inboxcase_end = data;
 270          if (ctx->inboxcase && strncasecmp(data, inbox, INBOXLEN) == 0 &&
 271              (data[INBOXLEN] == '\0' || data[INBOXLEN] == ctx->sep)) {
 272                  /* data begins with INBOX/, use case-insensitive comparison 
 273                     for it */
 274                  ctx->inboxcase_end += INBOXLEN;
 275          }
 276   
 277          if (*pattern != '*') {
 278                  /* handle the pattern up to the first '*' */
 279                  ret = match_sub(ctx, &data, &pattern);
 280                  if (ret != IMAP_MATCH_YES || *pattern == '\0')
 281                          return ret;
 282          }
 283   
 284          match = IMAP_MATCH_CHILDREN;
 285          while (*pattern == '*') {
 286                  pattern++;
 287   
 288                  if (*pattern == '\0')
 289                          return IMAP_MATCH_YES;
 290   
 291                  while (*data != '\0') {
Show more  
Show more  
Show more  




Change Warning 7513.24515 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: