(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/index-storage.c) |
| |
| 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) |
Event 5:
Taking true branch. index_dir == (void *)0 evaluates to true.
hide
|
|
| 163 | | | memset(&st, 0, sizeof(st)); |
| 164 | | | |
| 165 | | | |
| 166 | | | |
| 167 | | | destroy_count = 0; index = NULL; |
| 168 | | | for (list = &indexes; *list != NULL;) { |
Event 6:
Leaving loop. *list != (void *)0 evaluates to false.
hide
|
|
| 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)) {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/compat.h |
| |
59 | # define CMP_DEV_T(a, b) (major(a) == major(b) && minor(a) == minor(b)) |
| |
x /usr/include/sys/sysmacros.h |
| |
65 | # define major(dev) gnu_dev_major (dev) |
| |
x /usr/include/sys/sysmacros.h |
| |
65 | # define major(dev) gnu_dev_major (dev) |
| |
x /usr/include/sys/sysmacros.h |
| |
66 | # define minor(dev) gnu_dev_minor (dev) |
| |
x /usr/include/sys/sysmacros.h |
| |
66 | # define minor(dev) gnu_dev_minor (dev) |
| |
|
| 174 | | | |
| 175 | | | |
| 176 | | | |
| 177 | | | if (stat(rec->index->dir, &st2) < 0 || |
| 178 | | | st2.st_ino != st.st_ino || |
| 179 197 |  | | [ 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) { |
Event 7:
Taking true branch. index == (void *)0 evaluates to true.
hide
|
|
| 209 | [+] | | index = mail_index_alloc(index_dir, prefix); |
Event 8:
index_dir, which evaluates to NULL, is passed to mail_index_alloc() as the first argument. See related event 4.
hide
|
|
 |
| |