Text   |  XML   |  ReML   |   Visible Warnings:

Use After Free  at imem.c:25

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

mail_storage_set_error

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/mail-storage.c)expand/collapse
Show more  
 273  void mail_storage_set_error(struct mail_storage *storage,
 274                              enum mail_error error, const char *string)
 275  {
 276          i_free(storage->error_string);
 277[+]         storage->error_string = i_strdup(string);
expand/collapse

i_strdup

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.c)expand/collapse
Show more  
 23  char *i_strdup(const char *str)
 24  {
 25      char *rv = strdup( str );
Show more  
Show more  
Show more  




Change Warning 11948.24846 : Use After Free

Priority:
State:
Finding:
Owner:
Note: