Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at imap-match.c:194

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);
expand/collapse

match_sub

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-imap/imap-match.c)expand/collapse
Show more  
 184  match_sub(struct imap_match_context *ctx, const char **data_p,
 185            const char **pattern_p)
 186  {
 187          enum imap_match_result ret, match;
 188          unsigned int i;
 189          const char *data = *data_p, *pattern = *pattern_p;
 190   
 191          /* match all non-wildcards */
 192          i = 0;
 193          while (pattern[i] != '\0' && pattern[i] != '*' && pattern[i] != '%') {
 194                  if (!CMP_CUR_CHR(ctx, data+i, pattern+i)) {
Show more  
Show more  
Show more  
Show more  




Change Warning 7512.24514 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: