(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/fts/fts-storage.c) |
| |
| 298 | | | static int fts_build_init_virtual_next(struct fts_search_context *fctx) |
| 299 | | | { |
| 300 | | | struct fts_search_virtual_context *vctx = &fctx->virtual_ctx; |
| 301 | | | struct mailbox_status status; |
| 302 | | | const struct fts_orig_mailboxes *boxes; |
| 303 | | | const struct fts_backend_uid_map *last_uids; |
| 304 | | | unsigned int boxi, uidi, box_count, last_uid_count; |
| 305 | | | const char *vname; |
| 306 | | | string_t *tmp; |
| 307 | | | int ret, vret = 0; |
| 308 | | | |
| 309 | | | if (vctx->pool == NULL) |
| 310 | | | return 0; |
| 311 | | | |
| 312 | | | if (fctx->virtual_ctx.trans != NULL) |
| 313 | | | (void)mailbox_transaction_commit(&fctx->virtual_ctx.trans); |
| 314 | | | |
| 315 | | | boxes = array_get(&vctx->orig_mailboxes, &box_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)) |
| |
|
| 316 | | | last_uids = array_get(&vctx->last_uids, &last_uid_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)) |
| |
|
| 317 | | | |
| 318 | | | tmp = t_str_new(256); |
| 319 | | | boxi = vctx->boxi; |
| 320 | | | uidi = vctx->uidi; |
| 321 | | | while (vret == 0 && boxi < box_count && uidi < last_uid_count) { |
| 322 | | | vname = mail_namespace_get_vname(boxes[boxi].ns, tmp, |
Unreachable Call
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 323 | | | boxes[boxi].name); |
| 324 | | | ret = strcmp(vname, last_uids[uidi].mailbox); |
| 325 | | | if (ret == 0) { |
| 326 | | | |
| 327 | | | mailbox_get_status(boxes[boxi].box, STATUS_UIDVALIDITY, |
| 328 | | | &status); |
| 329 | | | if (status.uidvalidity != last_uids[uidi].uidvalidity) { |
| 330 | | | uidi++; |
| 331 | | | continue; |
| 332 | | | } |
| 333 | | | vret = fts_build_init_box(fctx, boxes[boxi].box, |
| 334 | | | last_uids[uidi].uid); |
| 335 | | | boxi++; |
| 336 | | | uidi++; |
| 337 | | | } else if (ret > 0) { |
| 338 | | | |
| 339 | | | uidi++; |
| 340 | | | } else { |
| 341 | | | |
| 342 | | | vret = fts_build_init_box(fctx, boxes[boxi].box, 0); |
| 343 | | | boxi++; |
| 344 | | | } |
| 345 | | | } |
| 346 | | | while (vret == 0 && boxi < box_count) { |
| 347 | | | vret = fts_build_init_box(fctx, boxes[boxi].box, 0); |
| 348 | | | boxi++; |
| 349 | | | } |
| 350 | | | vctx->boxi = boxi; |
| 351 | | | vctx->uidi = uidi; |
| 352 | | | return vret; |
| 353 | | | } |
| |