Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at virtual-storage.c:219

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

virtual_mailboxes_open

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/virtual/virtual-storage.c)expand/collapse
Show more  
 202  static int virtual_mailboxes_open(struct virtual_mailbox *mbox,
 203                                    enum mailbox_open_flags open_flags)
 204  {
 205          struct mail_user *user = mbox->storage->storage.ns->user;
 206          struct virtual_backend_box *const *bboxes;
 207          struct mail_namespace *ns;
 208          struct mail_storage *storage;
 209          unsigned int i, count;
 210          enum mail_error error;
 211          const char *str, *mailbox;
 212   
 213          open_flags |= MAILBOX_OPEN_KEEP_RECENT;
 214   
 215          bboxes = array_get(&mbox->backend_boxes, &count);
 216          for (i = 0; i < count; ) {
 217                  mailbox = bboxes[i]->name;
 218[+]                 ns = mail_namespace_find(user->namespaces, &mailbox);
 219                  storage = ns->storage;
 220                  bboxes[i]->box = mailbox_open(&storage, mailbox,
 221                                                NULL, open_flags);
 222   
 223                  if (bboxes[i]->box == NULL) {
 224                          str = mail_storage_get_last_error(storage, &error);
 225                          if (bboxes[i]->wildcard &&
 226                              (error == MAIL_ERROR_PERM ||
 227                               error == MAIL_ERROR_NOTFOUND)) {
 228                                  /* this mailbox wasn't explicitly specified.
 229                                     just skip it. */
 230                                  mail_search_args_unref(&bboxes[i]->search_args);
 231                                  array_delete(&mbox->backend_boxes, i, 1);
 232                                  bboxes = array_get(&mbox->backend_boxes, &count);
 233                                  continue;
 234                          }
 235                          if (storage != mbox->ibox.box.storage) {
 236                                  /* copy the error */
 237                                  mail_storage_set_error(mbox->ibox.box.storage,
 238                                                         error, str);
 239                          }
 240                          break;
 241                  }
 242                  i_array_init(&bboxes[i]->uids, 64);
 243                  i_array_init(&bboxes[i]->sync_pending_removes, 64);
 244                  mail_search_args_init(bboxes[i]->search_args, bboxes[i]->box,
 245                                        FALSE, NULL);
 246                  i++;
Show more  




Change Warning 8144.24845 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: