Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at imem.c:25

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

raw_mailbox_open

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/raw/raw-storage.c)expand/collapse
Show more  
 130  static struct mailbox *
 131  raw_mailbox_open(struct mail_storage *_storage, const char *name,
 132                   struct istream *input, enum mailbox_open_flags flags)
 133  {
 134          struct raw_storage *storage = (struct raw_storage *)_storage;
 135          struct raw_mailbox *mbox;
 136          const char *path;
 137          pool_t pool;
 138          bool stream = input != NULL;
 139   
 140          flags |= MAILBOX_OPEN_READONLY | MAILBOX_OPEN_NO_INDEX_FILES;
 141   
 142          path = mailbox_list_get_path(_storage->list, name,
 143                                       MAILBOX_LIST_PATH_TYPE_MAILBOX);
 144          if (input != NULL)
 145                  i_stream_ref(input);
 146          else {
 147                  if (raw_mailbox_open_input(_storage, name, path, &input) < 0)
 148                          return NULL;
 149          }
 150   
 151          pool = pool_alloconly_create("raw mailbox", 1024+512);
 152          mbox = p_new(pool, struct raw_mailbox, 1);
 153          mbox->ibox.box = raw_mailbox;
 154          mbox->ibox.box.pool = pool;
 155          mbox->ibox.storage = &storage->storage;
 156          mbox->ibox.mail_vfuncs = &raw_mail_vfuncs;
 157[+]         mbox->ibox.index = index_storage_alloc(_storage, name, flags, NULL);
expand/collapse

index_storage_alloc

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/index-storage.c)expand/collapse
Show more  
 148  struct mail_index *
 149  index_storage_alloc(struct mail_storage *storage, const char *name,
 150                      enum mailbox_open_flags flags, const char *prefix)
 151  {
 152          struct index_list **list, *rec;
 153          struct mail_index *index;
 154          struct stat st, st2;
 155          const char *index_dir, *mailbox_path;
 156          int destroy_count;
 157   
 158          mailbox_path = mailbox_list_get_path(storage->list, name,
 159                                               MAILBOX_LIST_PATH_TYPE_MAILBOX);
 160[+]         index_dir = get_index_dir(storage, name, flags, &st);
 161   
 162          if (index_dir == NULL)
 163                  memset(&st, 0, sizeof(st));
 164   
 165          /* compare index_dir inodes so we don't break even with symlinks.
 166             for in-memory indexes compare just mailbox paths */
 167          destroy_count = 0; index = NULL;
 168          for (list = &indexes; *list != NULL;) {
 169                  rec = *list;
 170   
 171                  if (index_dir != NULL) {
 172                          if (index == NULL && st.st_ino == rec->index_dir_ino &&
 173                              CMP_DEV_T(st.st_dev, rec->index_dir_dev)) {
 174                                  /* make sure the directory still exists.
 175                                     it might have been renamed and we're trying 
 176                                     to access it via its new path now. */
 177                                  if (stat(rec->index->dir, &st2) < 0 ||
 178                                      st2.st_ino != st.st_ino ||
 179
197
Show [ Lines 179 to 197 omitted. ]
 198                                  index_list_free(rec);
 199                                  continue;
 200                          } else {
 201                                  destroy_count++;
 202                          }
 203                  }
 204   
 205                  list = &(*list)->next;
 206          }
 207   
 208          if (index == NULL) {
 209[+]                 index = mail_index_alloc(index_dir, prefix);
expand/collapse

mail_index_alloc

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index.c)expand/collapse
Show more  
 28  struct mail_index *mail_index_alloc(const char *dir, const char *prefix)
 29  {
 30          struct mail_index *index;
 31   
 32          index = i_new(struct mail_index, 1);
 33          index->dir = i_strdup(dir);
 34[+]         index->prefix = i_strdup(prefix);
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  
Show more  




Change Warning 11994.25913 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: