(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/acl/acl-mailbox-list.c) |
| |
| 64 | | | acl_mailbox_try_list_fast(struct acl_mailbox_list_iterate_context *ctx) |
| 65 | | | { |
| 66 | | | struct acl_mailbox_list *alist = ACL_LIST_CONTEXT(ctx->ctx.list);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/acl/acl-mailbox-list.c |
| |
15 | #define ACL_LIST_CONTEXT(obj) \ |
16 | MODULE_CONTEXT(obj, acl_mailbox_list_module) |
| |
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) |
| |
|
| 67 | | | struct acl_backend *backend = alist->rights.backend; |
| 68 | | | const unsigned int *idxp; |
| 69 | | | const struct acl_mask *acl_mask; |
| 70 | | | struct acl_mailbox_list_context *nonowner_list_ctx; |
| 71 | | | struct mail_namespace *ns = ctx->ctx.list->ns; |
| 72 | | | struct mailbox_list_iter_update_context update_ctx; |
| 73 | | | const char *name; |
| 74 | | | string_t *vname = NULL; |
| 75 | | | int ret; |
| 76 | | | |
| 77 | | | if ((ctx->ctx.flags & (MAILBOX_LIST_ITER_RAW_LIST | |
| 78 | | | MAILBOX_LIST_ITER_SELECT_SUBSCRIBED)) != 0) |
| 79 | | | return; |
| 80 | | | |
| 81 | | | |
| 82 | | | |
| 83 | | | idxp = alist->rights.acl_storage_right_idx + ACL_STORAGE_RIGHT_LOOKUP; |
| 84 | | | if (acl_backend_get_default_rights(backend, &acl_mask) < 0 || |
| 85 | | | acl_cache_mask_isset(acl_mask, *idxp)) |
| 86 | | | return; |
| 87 | | | |
| 88 | | | |
| 89 | | | if ((ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) != 0) |
| 90 | | | vname = t_str_new(256); |
| 91 | | | |
| 92 | | | memset(&update_ctx, 0, sizeof(update_ctx)); |
| 93 | | | update_ctx.iter_ctx = &ctx->ctx; |
| 94 | | | update_ctx.glob = |
| 95 | | | imap_match_init(pool_datastack_create(), "*", |
| 96 | | | (ns->flags & NAMESPACE_FLAG_INBOX) != 0, |
| 97 | | | ctx->sep); |
| 98 | | | update_ctx.match_parents = TRUE; |
| 99 | | | update_ctx.tree_ctx = mailbox_tree_init(ctx->sep); |
| 100 | | | |
| 101 | | | nonowner_list_ctx = acl_backend_nonowner_lookups_iter_init(backend); |
| 102 | | | while ((ret = acl_backend_nonowner_lookups_iter_next(nonowner_list_ctx, |
| 103 | | | &name)) > 0) { |
| 104 | | | if (vname != NULL) |
| 105 | | | name = mail_namespace_get_vname(ns, vname, name); |
Unreachable Data Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 106 | | | mailbox_list_iter_update(&update_ctx, name); |
| 107 | | | } |
| 108 | | | acl_backend_nonowner_lookups_iter_deinit(&nonowner_list_ctx); |
| 109 | | | |
| 110 | | | if (ret == 0) |
| 111 | | | ctx->lookup_boxes = update_ctx.tree_ctx; |
| 112 | | | else |
| 113 | | | mailbox_tree_deinit(&update_ctx.tree_ctx); |
| 114 | | | } |
| |