(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/dbox/dbox-sync-file.c) |
| |
| 87 | | | dbox_sync_file_expunge(struct dbox_sync_context *ctx, struct dbox_file *file, |
| 88 | | | const struct dbox_sync_file_entry *entry) |
| 89 | | | { |
| 90 | | | const struct seq_range *expunges; |
| 91 | | | struct dbox_file *out_file = NULL; |
| 92 | | | struct istream *input; |
| 93 | | | struct ostream *output; |
| 94 | | | uint32_t file_id, seq, uid; |
| 95 | | | uoff_t first_offset, offset, physical_size; |
| 96 | | | const char *out_path; |
| 97 | | | unsigned int i, count; |
| 98 | | | bool expunged; |
| 99 | | | int ret; |
| 100 | | | |
| 101 | | | expunges = array_get(&entry->expunges, &count);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
156 | #define array_get(array, count) \ |
157 | ARRAY_TYPE_CAST_CONST(array)array_get_i(&(array)->arr, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
43 | # define ARRAY_TYPE_CAST_CONST(array) \ |
44 | (typeof(*(array)->v)) |
| |
|
| 102 | | | if (!dbox_file_lookup(ctx->mbox, ctx->sync_view, expunges[0].seq1, |
| 103 | [+] | | &file_id, &first_offset)) |
 |
| 104 | | | return 0; |
| 105 | | | i_assert(file_id == file->file_id);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
189 | #define i_assert(expr) STMT_START{ \ |
190 | if (unlikely(!(expr))) \ |
191 | i_panic("file %s: line %d (%s): assertion failed: (%s)", \ |
192 | __FILE__, \ |
193 | __LINE__, \ |
194 | __PRETTY_FUNCTION__, \ |
195 | #expr); }STMT_END |
| |
|
Event 5:
Skipping " if". file_id == file->file_id evaluates to true.
hide
Event 6:
Skipping " if". !(file_id == file->file_id) evaluates to false.
hide
Event 7:
Skipping " if". !!(file_id == file->file_id) evaluates to true.
hide
Event 8:
Skipping " if". !!!(file_id == file->file_id) evaluates to false.
hide
Event 9:
Skipping " if". __builtin_expect(...) evaluates to false.
hide
|
|
| 106 | | | mail_index_expunge(ctx->trans, expunges[0].seq1); |
| 107 | | | |
| 108 | | | offset = first_offset; |
| 109 | | | for (i = 0;;) { |
| 110 | | | if ((ret = dbox_file_seek_next(file, &offset, &uid, |
| 111 | | | &physical_size)) <= 0) |
Event 10:
Skipping " if". (ret = dbox_file_seek_next(...)) <= 0 evaluates to false.
hide
|
|
| 112 | | | break; |
| 113 | | | if (uid == 0) { |
Event 11:
Skipping " if". uid == 0 evaluates to false.
hide
|
|
| 114 | | | |
| 115 | | | break; |
| 116 | | | } |
| 117 | | | |
| 118 | | | if (i < count) { |
Event 12:
Taking true branch. i < count evaluates to true.
hide
|
|
| 119 | | | mail_index_lookup_seq(ctx->sync_view, uid, &seq); |
| 120 | | | while (seq > expunges[i].seq2) { |
Event 13:
Entering loop body. seq > expunges[i].seq2 evaluates to true.
hide
Event 15:
Continuing from loop body. Leaving loop. seq > expunges[i].seq2 evaluates to false.
hide
|
|
| 121 | | | if (++i == count) |
Event 14:
Skipping " if". ++i == count evaluates to false.
hide
|
|
| 122 | | | break; |
| 123 | | | } |
| 124 | | | } |
| 125 | | | if (seq == 0 || (i < count && seq >= expunges[i].seq1 && |
Event 16:
Skipping " if". - seq == 0 evaluates to false.
- i < count evaluates to true.
- seq >= expunges[i].seq1 evaluates to false.
hide
|
|
| 126 | | | seq <= expunges[i].seq2)) { |
| 127 | | | |
| 128 | | | if (seq != 0) |
| 129 | | | mail_index_expunge(ctx->trans, seq); |
| 130 | | | continue; |
| 131 | | | } |
| 132 | | | |
| 133 | | | |
| 134 | | | if (out_file == NULL) { |
Event 17:
Taking true branch. out_file == (void *)0 evaluates to true.
hide
|
|
| 135 | [+] | | out_file = dbox_file_init(ctx->mbox, 0); |
 |
| 136 | | | ret = dbox_file_get_append_stream(out_file, |
| 137 | | | physical_size, |
| 138 | [+] | | &output); |
Event 25:
dbox_file_get_append_stream() does not initialize output. - This may be because of a failure case or other special case for dbox_file_get_append_stream().
hide
|
|
 |
| 139 | | | if (ret <= 0) |
Event 28:
Taking true branch. ret <= 0 evaluates to true.
hide
|
|
| 140 | | | break; |
| 141 | | | } |
| 142 | | | |
| 143 | | | i_stream_seek(file->input, offset); |
| 144 | | | input = i_stream_create_limit(file->input, |
| 145 | | | file-> + |
| 146 | | | physical_size); |
| 147 | | | ret = o_stream_send_istream(output, input) < 0 ? -1 : 0; |
| 148 | | | i_stream_unref(&input); |
| 149 | | | if (ret < 0) |
| 150 | | | break; |
| 151 | | | |
| 152 | | | |
| 153 | | | (void)dbox_file_metadata_seek_mail_offset(file, offset, |
| 154 | | | &expunged); |
| 155 | | | 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(); |
| |
|
| 156 | | | dbox_sync_update_metadata(ctx, file, entry, seq); |
| 157 | | | } T_END; |
| 158 | | | if ((ret = dbox_file_metadata_write_to(file, output)) < 0) |
| 159 | | | break; |
| 160 | | | |
| 161 | | | mail_index_update_flags(ctx->trans, seq, MODIFY_REMOVE, |
| 162 | | | (enum mail_flags)MAIL_INDEX_MAIL_FLAG_DIRTY); |
| 163 | | | } |
| 164 | | | |
| 165 | | | out_path = out_file == NULL ? NULL : |
Event 29:
out_file == (void *)0 evaluates to false.
hide
|
|
| 166 | | | dbox_file_get_path(out_file); |
| 167 | | | if (ret <= 0) { |
Event 30:
Taking true branch. ret <= 0 evaluates to true.
hide
|
|
| 168 | | | if (out_file != NULL) { |
Event 31:
Taking true branch. out_file != (void *)0 evaluates to true.
hide
|
|
| 169 | | | if (unlink(out_path) < 0) |
Event 32:
Skipping " if". unlink(out_path) < 0 evaluates to false.
hide
|
|
| 170 | | | i_error("unlink(%s) failed: %m", out_path); |
| 171 | [+] | | o_stream_unref(&output); |
Event 33:
&output is passed to o_stream_unref().
hide
Event 34:
o_stream_unref() does not initialize output. - This may be because of a failure case or other special case for o_stream_unref().
hide
|
|
 |
| |