(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/mail-copy.c) |
| |
| 8 | | | int mail_storage_copy(struct mail_save_context *ctx, struct mail *mail) |
| 9 | | | { |
| 10 | | | struct istream *input; |
| 11 | | | const char *from_envelope, *guid; |
| 12 | | | time_t received_date; |
| 13 | | | |
| 14 | [+] | | if (mail_get_stream(mail, NULL, NULL, &input) < 0) |
 |
| 15 | | | return -1; |
| 16 | | | |
| 17 | | | if (ctx->received_date == (time_t)-1) { |
Event 3:
Skipping " if". ctx->received_date == (time_t)-1 evaluates to false.
hide
|
|
| 18 | | | if (mail_get_received_date(mail, &received_date) < 0) |
| 19 | | | return -1; |
| 20 | | | mailbox_save_set_received_date(ctx, received_date, 0); |
| 21 | | | } |
| 22 | | | if (ctx->from_envelope == NULL) { |
Event 4:
Skipping " if". ctx->from_envelope == (void *)0 evaluates to false.
hide
|
|
| 23 | | | if (mail_get_special(mail, MAIL_FETCH_FROM_ENVELOPE, |
| 24 | | | &from_envelope) < 0) |
| 25 | | | return -1; |
| 26 | | | if (*from_envelope != '\0') |
| 27 | | | mailbox_save_set_from_envelope(ctx, from_envelope); |
| 28 | | | } |
| 29 | | | if (ctx->guid == NULL) { |
Event 5:
Taking true branch. ctx->guid == (void *)0 evaluates to true.
hide
|
|
| 30 | | | if (mail_get_special(mail, MAIL_FETCH_GUID, &guid) < 0) |
Event 6:
Skipping " if". mail_get_special(...) < 0 evaluates to false.
hide
|
|
| 31 | | | return -1; |
| 32 | | | if (*guid != '\0') |
Event 7:
Taking true branch. *guid != 0 evaluates to true.
hide
|
|
| 33 | [+] | | mailbox_save_set_guid(ctx, guid); |
Event 8:
ctx is passed to mailbox_save_set_guid() as the first argument.
hide
Event 9:
The resource of interest is allocated inside mailbox_save_set_guid().
hide
|
|
 |
| 34 | | | } |
| 35 | | | |
| 36 | [+] | | if (mailbox_save_begin(&ctx, input) < 0) |
 |
| |