(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/expire/expire-plugin.c) |
| |
| 94 | | | expire_mailbox_transaction_commit(struct mailbox_transaction_context *t, |
| 95 | | | uint32_t *uid_validity_r, |
| 96 | | | uint32_t *first_saved_uid_r, |
| 97 | | | uint32_t *last_saved_uid_r) |
| 98 | | | { |
| 99 | | | struct expire_mailbox *xpr_box = EXPIRE_CONTEXT(t->box);
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) |
| |
|
| 100 | | | struct expire_transaction_context *xt = EXPIRE_CONTEXT(t);
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) |
| |
|
| 101 | | | struct mailbox *box = t->box; |
| 102 | | | time_t new_stamp; |
| 103 | | | bool update_dict = FALSE; |
| 104 | | | int ret; |
| 105 | | | |
| 106 | | | if (xpr_box->altmove) { |
| 107 | | | |
| 108 | | | } else if (xt->first_expunged) { |
| 109 | | | |
| 110 | | | first_nonexpunged_timestamp(t, &new_stamp); |
| 111 | | | update_dict = TRUE; |
| 112 | | | } |
| 113 | | | |
| 114 | | | if (xpr_box->module_ctx.super. |
| 115 | | | transaction_commit(t, uid_validity_r, |
| 116 | | | first_saved_uid_r, last_saved_uid_r) < 0) { |
| 117 | | | i_free(xt);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.h |
| |
14 | #define i_free(mem) \ |
15 | STMT_START { \ |
16 | free(mem); \ |
17 | (mem) = NULL; \ |
18 | } STMT_END |
| |
|
| 118 | | | return -1; |
| 119 | | | } |
| 120 | | | |
| 121 | | | t = NULL; |
| 122 | | | |
| 123 | | | if (xt->first_expunged || xt->saves) T_BEGIN {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/data-stack.h |
| |
49 | #define T_BEGIN \ |
50 | STMT_START { unsigned int _data_stack_cur_id = t_push(); |
| |
|
| 124 | | | const char *key, *value; |
| 125 | | | |
| 126 | | | key = t_strconcat(DICT_EXPIRE_PREFIX, |
| 127 | | | box->storage->ns->user->username, "/", |
| 128 | | | box->storage->ns->prefix, box->name, NULL); |
Ignored Return Value
The return value of t_strconcat() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- The return value of t_strconcat() is checked 98% of the time in this project. CodeSonar is configured to enforce Ignored Return Value checks for any function whose return value is checked at least 96% of the time, unless the function is used fewer than 20 times. (To modify these thresholds, use configuration file parameters RETURN_CHECKER_SAMPLE_SIZE and RETURN_CHECKER_RATIO. To exempt t_strconcat() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 129 | | | if (!xt->first_expunged && xt->saves) { |
Event 2:
Skipping " if". xt->first_expunged evaluates to true.
hide
|
|
| 130 | | | |
| 131 | | | |
| 132 | | | ret = dict_lookup(expire.db, pool_datastack_create(), |
| 133 | | | key, &value); |
| 134 | | | update_dict = ret == 0 || |
| 135 | | | (ret > 0 && strtoul(value, NULL, 10) == 0); |
| 136 | | | |
| 137 | | | |
| 138 | | | new_stamp = ioloop_time; |
| 139 | | | } |
| 140 | | | |
| 141 | | | if (update_dict) { |
Event 3:
Skipping " if". update_dict evaluates to false.
hide
|
|
| 142 | | | struct dict_transaction_context *dctx; |
| 143 | | | |
| 144 | | | dctx = dict_transaction_begin(expire.db); |
| 145 | | | if (new_stamp == 0) { |
| 146 | | | |
| 147 | | | dict_unset(dctx, key); |
| 148 | | | } else { |
| 149 | | | new_stamp += xpr_box->expire_secs; |
| 150 | | | dict_set(dctx, key, dec2str(new_stamp)); |
| 151 | | | } |
| 152 | | | dict_transaction_commit(&dctx); |
| 153 | | | } |
| 154 | | | } T_END; |
| 155 | | | i_free(xt);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.h |
| |
14 | #define i_free(mem) \ |
15 | STMT_START { \ |
16 | free(mem); \ |
17 | (mem) = NULL; \ |
18 | } STMT_END |
| |
|
| 156 | | | return 0; |
| 157 | | | } |
| |