(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/dbox/dbox-index.c) |
| |
| 720 | | | int dbox_index_append_next(struct dbox_index_append_context *ctx, |
| 721 | | | uoff_t mail_size, |
| 722 | | | struct dbox_file **file_r, |
| 723 | | | struct ostream **output_r) |
| 724 | | | { |
| 725 | | | struct dbox_file *const *files, *file = NULL; |
| 726 | | | struct dbox_index_record *records; |
| 727 | | | unsigned int i, count; |
| 728 | | | int ret; |
| 729 | | | |
| 730 | | | |
| 731 | | | files = array_get(&ctx->files, &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)) |
| |
|
| 732 | | | for (i = 0; i < count; i++) { |
Event 1:
Entering loop body. i < count evaluates to true.
hide
Event 3:
Continuing from loop body. Leaving loop. i < count evaluates to false.
hide
|
|
| 733 | | | if (dbox_file_get_append_stream(files[i], mail_size, |
| 734 | | | output_r) > 0) { |
Event 2:
Skipping " if". dbox_file_get_append_stream(...) > 0 evaluates to false.
hide
|
|
| 735 | | | *file_r = files[i]; |
| 736 | | | return 0; |
| 737 | | | } |
| 738 | | | } |
| 739 | | | |
| 740 | | | |
| 741 | | | records = array_get_modifiable(&ctx->index->records, &count);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
174 | #define array_get_modifiable(array, count) \ |
175 | ARRAY_TYPE_CAST_MODIFIABLE(array) \ |
176 | array_get_modifiable_i(&(array)->arr, count) |
| |
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)) |
| |
|
| 742 | | | for (i = 0; i < count; i++) { |
Event 4:
Leaving loop. i < count evaluates to false.
hide
|
|
| 743 | | | if (dbox_index_append_file_record(ctx, &records[i], mail_size, |
| 744 | | | &file, output_r)) |
| 745 | | | break; |
| 746 | | | } |
| 747 | | | |
| 748 | | | if (file == NULL) { |
Event 5:
Taking true branch. file == (void *)0 evaluates to true.
hide
|
|
| 749 | | | |
| 750 | [+] | | file = dbox_file_init(ctx->index->mbox, 0); |
Event 6:
The resource of interest is allocated inside dbox_file_init().
hide
|
|
 |
| 751 | | | if ((ret = dbox_file_get_append_stream(file, mail_size, |
Event 23:
The resource of interest is passed to dbox_file_get_append_stream() as the first argument. - dbox_file_get_append_stream() does not free it or save any references that are freed later.
- file, which evaluates to malloc(size) from imem.c:9, is passed to dbox_file_get_append_stream() as the first argument.
See related event 22.
hide
|
|
| 752 | [+] | | output_r)) <= 0) { |
 |
| 753 | | | i_assert(ret < 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 64:
Skipping " if". ret < 0 evaluates to true.
hide
Event 65:
Skipping " if". !(ret < 0) evaluates to false.
hide
Event 66:
Skipping " if". !!(ret < 0) evaluates to true.
hide
Event 67:
Skipping " if". !!!(ret < 0) evaluates to false.
hide
Event 68:
Skipping " if". __builtin_expect(...) evaluates to false.
hide
|
|
| 754 | [+] | | (void)unlink(dbox_file_get_path(file)); |
Event 69:
The resource of interest is passed to dbox_file_get_path(). - dbox_file_get_path() does not free it or save any references that are freed later.
- file, which evaluates to malloc(size) from imem.c:9, is passed to dbox_file_get_path().
See related event 22.
hide
|
|
 |
| 755 | [+] | | dbox_file_unref(&file); |
Event 77:
&file is passed to dbox_file_unref().
hide
|
|
 |
| |