(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/mbox/mbox-storage.c) |
| |
| 848 | | | static int mbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx, |
| 849 | | | const char *dir, const char *fname, |
| 850 | | | const char *mailbox_name ATTR_UNUSED, |
| 851 | | | enum mailbox_list_file_type type, |
| 852 | | | enum mailbox_info_flags *flags) |
| 853 | | | { |
| 854 | | | struct mail_storage *storage = MBOX_LIST_CONTEXT(ctx->list);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/module-context.h |
| |
46 | #define MODULE_CONTEXT(obj, id_ctx) \ |
47 | (*((void **)array_idx_modifiable(&(obj)->module_contexts, \ |
48 | (id_ctx).id.module_id) + \ |
49 | OBJ_REGISTER_COMPATIBLE(obj, id_ctx))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
179 | #define array_idx_modifiable(array, idx) \ |
180 | ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
181 | array_idx_modifiable_i(&(array)->arr, idx) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
45 | # define ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
46 | (typeof(*(array)->v_modifiable)) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/module-context.h |
| |
43 | #define OBJ_REGISTER_COMPATIBLE(obj, id_ctx) \ |
44 | COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(OBJ_REGISTER(obj), (id_ctx).reg) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
158 | # define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \ |
159 | COMPILE_ERROR_IF_TRUE( \ |
160 | !__builtin_types_compatible_p(typeof(_a), typeof(_b))) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
156 | # define COMPILE_ERROR_IF_TRUE(condition) \ |
157 | (sizeof(char[1 - 2 * !!(condition)]) - 1) |
| |
|
| 855 | | | const char *path, *root_dir; |
| 856 | | | size_t len; |
| 857 | | | struct stat st; |
| 858 | | | |
| 859 | | | if (strcmp(fname, MBOX_INDEX_DIR_NAME) == 0) { |
Event 1:
Skipping " if". strcmp(fname, ".imap") == 0 evaluates to false.
hide
|
|
| 860 | | | *flags |= MAILBOX_NOSELECT; |
| 861 | | | return 0; |
| 862 | | | } |
| 863 | | | if (strcmp(fname, ctx->list->set.subscription_fname) == 0) { |
Event 2:
Skipping " if". strcmp(...) == 0 evaluates to false.
hide
|
|
| 864 | | | root_dir = mailbox_list_get_path(storage->list, NULL, |
| 865 | | | MAILBOX_LIST_PATH_TYPE_DIR); |
| 866 | | | if (strcmp(root_dir, dir) == 0) { |
| 867 | | | *flags |= MAILBOX_NOSELECT | MAILBOX_NOINFERIORS; |
| 868 | | | return 0; |
| 869 | | | } |
| 870 | | | } |
| 871 | | | |
| 872 | | | |
| 873 | | | len = strlen(fname); |
| 874 | | | if (len > 5 && strcmp(fname+len-5, ".lock") == 0) { |
Event 3:
Skipping " if". len > 5 evaluates to false.
hide
|
|
| 875 | | | *flags |= MAILBOX_NOSELECT | MAILBOX_NOINFERIORS; |
| 876 | | | return 0; |
| 877 | | | } |
| 878 | | | |
| 879 | | | |
| 880 | | | if (type == MAILBOX_LIST_FILE_TYPE_DIR) { |
Event 4:
Skipping " if". type == MAILBOX_LIST_FILE_TYPE_DIR evaluates to false.
hide
|
|
| 881 | | | *flags |= MAILBOX_NOSELECT | MAILBOX_CHILDREN; |
| 882 | | | return 1; |
| 883 | | | } |
| 884 | | | if (type != MAILBOX_LIST_FILE_TYPE_SYMLINK && |
Event 5:
Skipping " if". type != MAILBOX_LIST_FILE_TYPE_SYMLINK evaluates to false.
hide
|
|
| 885 | | | type != MAILBOX_LIST_FILE_TYPE_UNKNOWN && |
| 886 | | | (ctx->flags & MAILBOX_LIST_ITER_RETURN_NO_FLAGS) != 0) { |
| 887 | | | *flags |= MAILBOX_NOINFERIORS; |
| 888 | | | return 1; |
| 889 | | | } |
| 890 | | | |
| 891 | | | |
| 892 | [+] | | path = t_strconcat(dir, "/", fname, NULL); |
 |
| 893 | | | if (stat(path, &st) == 0) { |
Event 12:
path, which evaluates to NULL, is passed to stat64() as the first argument. See related event 11.
hide
Null Pointer Dereference
The body of stat64() dereferences path, but it is NULL. The issue can occur if the highlighted code executes. See related event 12. Show: All events | Only primary events |
|
| |