(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/virtual/virtual-sync.c) |
| |
| 1196 | | | static void virtual_sync_backend_add_new(struct virtual_sync_context *ctx) |
| 1197 | | | { |
| 1198 | | | uint32_t virtual_ext_id = ctx->mbox->virtual_ext_id; |
| 1199 | | | struct virtual_add_record *adds; |
| 1200 | | | struct virtual_backend_box *bbox; |
| 1201 | | | struct virtual_backend_uidmap *uidmap; |
| 1202 | | | const struct *hdr; |
| 1203 | | | const struct virtual_mail_index_record *vrec; |
| 1204 | | | unsigned int i, count, idx, uid_count; |
| 1205 | | | uint32_t vseq, first_uid, next_uid; |
| 1206 | | | |
| 1207 | | | hdr = (ctx->sync_view); |
| 1208 | [+] | | adds = array_get_modifiable(&ctx->all_adds, &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)) |
| |
|
 |
| 1209 | | | if (count == 0) { |
Event 1:
Skipping " if". count == 0 evaluates to false.
hide
|
|
| 1210 | | | ctx->mbox->sync_virtual_next_uid = hdr->next_uid; |
| 1211 | | | return; |
| 1212 | | | } |
| 1213 | | | |
| 1214 | | | if (adds[0].rec.mailbox_id == adds[count-1].rec.mailbox_id) { |
Event 2:
Skipping " if". adds[0].rec.mailbox_id == adds[count - 1].rec.mailbox_id evaluates to true.
hide
|
|
| 1215 | | | |
| 1216 | | | |
| 1217 | | | } else { |
| 1218 | | | |
| 1219 | | | virtual_sync_backend_sort_new(ctx); |
| 1220 | | | } |
| 1221 | | | |
| 1222 | | | for (bbox = NULL, i = 0; i < count; i++) { |
Event 3:
Entering loop body. i < count evaluates to true.
hide
|
|
| 1223 | | | vrec = &adds[i].rec; |
| 1224 | | | if (bbox == NULL || bbox->mailbox_id != vrec->mailbox_id) { |
Event 4:
Taking true branch. bbox == (void *)0 evaluates to true.
hide
|
|
| 1225 | | | bbox = virtual_backend_box_lookup(ctx->mbox, |
Event 7:
bbox is set to virtual_backend_box_lookup(...), which evaluates to NULL. See related event 6.
hide
|
|
| 1226 | [+] | | vrec->mailbox_id); |
 |
| 1227 | | | } |
| 1228 | | | |
| 1229 | | | mail_index_append(ctx->trans, 0, &vseq); |
| 1230 | | | mail_index_update_ext(ctx->trans, vseq, virtual_ext_id, |
| 1231 | | | vrec, NULL); |
| 1232 | [+] | | virtual_sync_external_flags(ctx, bbox, vseq, vrec->real_uid); |
Event 8:
bbox, which evaluates to NULL, is passed to virtual_sync_external_flags() as the second argument. See related event 7.
hide
|
|
 |
| |