(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-modseq.c) |
| |
| 364 | | | static void mail_index_modseq_sync_init(struct mail_index_modseq_sync *ctx) |
| 365 | | | { |
| 366 | | | struct mail_index_map *map = ctx->view->map; |
| 367 | | | const struct mail_index_ext *ext; |
| 368 | | | const struct *hdr; |
| 369 | | | const struct *thdr; |
| 370 | | | const void *tdata; |
| 371 | | | uint32_t ext_map_idx; |
| 372 | | | uint32_t end_seq; |
| 373 | | | uoff_t end_offset; |
| 374 | | | uint64_t cur_modseq; |
| 375 | | | bool reset; |
| 376 | | | int ret; |
| 377 | | | |
| 378 | | | if (!mail_index_map_get_ext_idx(map, ctx->view->index->modseq_ext_id, |
| 379 | | | &ext_map_idx)) |
| 380 | | | i_unreached();
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
208 | #define i_unreached() \ |
209 | i_panic("file %s: line %d: unreached", __FILE__, __LINE__) |
| |
|
| 381 | | | ext = array_idx(&map->extensions, ext_map_idx);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
165 | #define array_idx(array, idx) \ |
166 | ARRAY_TYPE_CAST_CONST(array)array_idx_i(&(array)->arr, idx) |
| |
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)) |
| |
|
| 382 | | | |
| 383 | | | |
| 384 | | | hdr = CONST_PTR_OFFSET(map->hdr_base, ext->hdr_offset);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/macros.h |
| |
29 | #define CONST_PTR_OFFSET(ptr, offset) \ |
30 | ((const void *) (((const unsigned char *) (ptr)) + (offset))) |
| |
|
| 385 | | | ctx->highest_modseq = hdr->highest_modseq; |
| 386 | | | |
| 387 | | | |
| 388 | | | |
| 389 | | | |
| 390 | | | |
| 391 | | | |
| 392 | | | |
| 393 | | | mail_transaction_log_view_get_prev_pos(ctx->view->log_view, |
| 394 | | | &end_seq, &end_offset); |
| 395 | | | if (end_seq <= hdr->log_seq || |
| 396 | | | (end_seq == hdr->log_seq && end_offset <= hdr->log_offset)) { |
Unreachable Conditional
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 397 | | | |
| 398 | | | return; |
| 399 | | | } |
| 400 | | | |
| 401 | | | ctx->log_view = mail_transaction_log_view_open(ctx->view->index->log); |
| 402 | | | ret = mail_transaction_log_view_set(ctx->log_view, |
| 403 | | | I_MAX(1, hdr->log_seq), |
| 404 | | | hdr->log_offset, |
| 405 | | | end_seq, end_offset, &reset); |
| 406 | | | if (ret == 0) { |
| 407 | | | |
| 408 | | | ret = mail_transaction_log_view_set(ctx->log_view, end_seq, 0, |
| 409 | | | end_seq, end_offset, |
| 410 | | | &reset); |
| 411 | | | |
| 412 | | | |
| 413 | | | cur_modseq = mail_transaction_log_view_get_prev_modseq( |
| 414 | | | ctx->log_view); |
| 415 | | | if (cur_modseq < hdr->highest_modseq) { |
| 416 | | | |
| 417 | | | |
| 418 | | | |
| 419 | | | cur_modseq = hdr->highest_modseq; |
| 420 | | | } |
| 421 | | | mail_index_modseq_update(ctx, cur_modseq, TRUE, 1, |
| 422 | | | map->hdr.messages_count); |
| 423 | | | } else { |
| 424 | | | |
| 425 | | | |
| 426 | | | mail_index_modseq_update(ctx, hdr->highest_modseq, FALSE, 1, |
| 427 | | | map->hdr.messages_count); |
| 428 | | | } |
| 429 | | | if (ret > 0) { |
| 430 | | | while (mail_transaction_log_view_next(ctx->log_view, |
| 431 | | | &thdr, &tdata) > 0) { |
| 432 | | | T_BEGIN {
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/data-stack.h |
| |
49 | #define T_BEGIN \ |
50 | STMT_START { unsigned int _data_stack_cur_id = t_push(); |
| |
|
| 433 | | | mail_index_modseq_update_old_rec(ctx, thdr, |
| 434 | | | tdata); |
| 435 | | | } T_END; |
| 436 | | | } |
| 437 | | | } |
| 438 | | | mail_index_sync_write_seq_update(ctx->sync_map_ctx, 1, |
| 439 | | | map->hdr.messages_count); |
| 440 | | | mail_transaction_log_view_close(&ctx->log_view); |
| 441 | | | } |
| |