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

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);
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 11833.25672 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: