(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-copy.c) |
| |
| 129 | | | maildir_copy_hardlink(struct maildir_transaction_context *t, struct mail *mail, |
| 130 | | | enum mail_flags flags, struct mail_keywords *keywords, |
| 131 | | | struct mail *dest_mail) |
| 132 | | | { |
| 133 | | | struct maildir_mailbox *dest_mbox = |
| 134 | | | (struct maildir_mailbox *)t->ictx.ibox; |
| 135 | | | struct maildir_mailbox *src_mbox; |
| 136 | | | struct hardlink_ctx do_ctx; |
| 137 | | | const char *path, *filename = NULL; |
| 138 | | | |
| 139 | | | i_assert((t->ictx.flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0);
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 1:
Skipping " if". (t->ictx.flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0 evaluates to true.
hide
Event 2:
Skipping " if". !((t->ictx.flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0) evaluates to false.
hide
Event 3:
Skipping " if". !!((t->ictx.flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0) evaluates to true.
hide
Event 4:
Skipping " if". !!!((t->ictx.flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0) evaluates to false.
hide
Event 5:
Skipping " if". __builtin_expect(...) evaluates to false.
hide
|
|
| 140 | | | |
| 141 | | | if (strcmp(mail->box->storage->name, MAILDIR_STORAGE_NAME) == 0) |
Event 6:
Taking false branch. strcmp(...) == 0 evaluates to false.
hide
|
|
| 142 | | | src_mbox = (struct maildir_mailbox *)mail->box; |
| 143 | | | else if (strcmp(mail->box->storage->name, "raw") == 0) { |
Event 7:
Taking true branch. strcmp(...) == 0 evaluates to true.
hide
|
|
| 144 | | | |
| 145 | | | src_mbox = NULL; |
| 146 | | | } else { |
| 147 | | | |
| 148 | | | return 0; |
| 149 | | | } |
| 150 | | | |
| 151 | | | if (t->save_ctx == NULL) |
Event 8:
Taking true branch. t->save_ctx == (void *)0 evaluates to true.
hide
|
|
| 152 | | | t->save_ctx = maildir_save_transaction_init(t); |
| 153 | | | |
| 154 | | | |
| 155 | | | flags &= ~MAIL_RECENT; |
| 156 | | | if (dest_mbox->ibox.keep_recent) |
Event 9:
Taking true branch. dest_mbox->ibox.keep_recent evaluates to true.
hide
|
|
| 157 | | | flags |= MAIL_RECENT; |
| 158 | | | |
| 159 | | | memset(&do_ctx, 0, sizeof(do_ctx)); |
| 160 | | | do_ctx.dest_path = str_new(default_pool, 512); |
| 161 | | | |
| 162 | | | if (dest_mbox->storage->copy_preserve_filename && src_mbox != NULL) { |
Event 10:
Skipping " if". dest_mbox->storage->copy_preserve_filename evaluates to false.
hide
|
|
| 163 | | | enum maildir_uidlist_rec_flag src_flags; |
| 164 | | | const char *src_fname; |
| 165 | | | |
| 166 | | | |
| 167 | | | |
| 168 | | | |
| 169 | | | |
| 170 | | | if (maildir_uidlist_lookup(src_mbox->uidlist, |
| 171 | | | mail->uid, &src_flags, |
| 172 | | | &src_fname) > 0 && |
| 173 | | | maildir_uidlist_refresh(dest_mbox->uidlist) >= 0 && |
| 174 | | | maildir_uidlist_get_full_filename(dest_mbox->uidlist, |
| 175 | | | src_fname) == NULL) |
| 176 | | | filename = t_strcut(src_fname, ':'); |
| 177 | | | } |
| 178 | | | if (filename == NULL) { |
Event 11:
Skipping " if". filename == (void *)0 evaluates to true.
hide
|
|
| 179 | | | |
| 180 | | | |
| 181 | [+] | | do_ctx.dest_fname = maildir_filename_generate(); |
 |
| 182 | | | } else { |
| 183 | | | do_ctx.dest_fname = filename; |
| 184 | | | do_ctx.preserve_filename = TRUE; |
| 185 | | | } |
| 186 | | | |
| 187 | | | |
| 188 | | | |
| 189 | | | |
| 190 | | | |
| 191 | | | #if 0 |
| 192 202 |  | | [ Lines 192 to 202 omitted. ] |
| 203 | | | str_append(do_ctx.dest_path, |
| 204 | | | maildir_filename_set_flags(NULL, |
| 205 | | | do_ctx.dest_fname, |
| 206 | | | flags, NULL)); |
| 207 | | | } |
| 208 | | | } else |
| 209 | | | #endif |
| 210 | | | { |
| 211 | | | |
| 212 | | | |
| 213 | | | str_printfa(do_ctx.dest_path, "%s/tmp/%s", |
| 214 | | | dest_mbox->path, do_ctx.dest_fname); |
| 215 | | | do_ctx.base_end_pos = str_len(do_ctx.dest_path); |
| 216 | | | } |
| 217 | | | if (src_mbox != NULL) { |
Event 46:
Taking false branch. src_mbox != (void *)0 evaluates to false.
hide
|
|
| 218 | | | |
| 219 | | | if (maildir_file_do(src_mbox, mail->uid,
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-storage.h |
| |
117 | # define maildir_file_do(mbox, seq, callback, context) \ |
118 | ({(void)(1 ? 0 : callback((struct maildir_mailbox *)NULL, \ |
119 | (const char *)NULL, context)); \ |
120 | maildir_file_do(mbox, seq, \ |
121 | (maildir_file_do_func *)callback, context); }) |
| |
|
| 220 | | | do_hardlink, &do_ctx) < 0) |
| 221 | | | return -1; |
| 222 | | | } else { |
| 223 | | | |
| 224 | | | if (mail_get_special(mail, MAIL_FETCH_UIDL_FILE_NAME, |
| 225 | | | &path) < 0 || *path == '\0') |
Event 47:
Skipping " if". - mail_get_special(...) < 0 evaluates to false.
- *path == 0 evaluates to false.
hide
|
|
| 226 | | | return 0; |
| 227 | [+] | | if (do_hardlink(dest_mbox, path, &do_ctx) < 0) |
 |
| 228 | | | return -1; |
| 229 | | | } |
| 230 | | | |
| 231 | | | if (!do_ctx.success) { |
Event 56:
Skipping " if". do_ctx.success evaluates to true.
hide
|
|
| 232 | | | |
| 233 | | | return 0; |
| 234 | | | } |
| 235 | | | |
| 236 | | | #if 0 |
| 237 | | | if (keywords == NULL || keywords->count == 0) { |
| 238 | | | |
| 239 | | | maildir_save_add(t, do_ctx.dest_fname, |
| 240 | | | flags | MAILDIR_SAVE_FLAG_HARDLINK, NULL, |
| 241 | | | dest_mail); |
| 242 | | | } else |
| 243 | | | #endif |
| 244 | | | { |
| 245 | | | |
| 246 | | | maildir_save_add(t, do_ctx.dest_fname, flags, keywords, |
Event 57:
do_ctx.dest_fname, which evaluates to the value assigned to ret at data-stack.c:335, is passed to maildir_save_add() as the second argument. See related event 45.
hide
|
|
| 247 | [+] | | dest_mail); |
 |
| |