Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Call  at mail-index-transaction.c:523

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

mail_index_transaction_sort_appends

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-transaction.c)expand/collapse
Show more  
 490  void mail_index_transaction_sort_appends(struct mail_index_transaction *t)
 491  {
 492          struct mail_index_record *recs, *sorted_recs;
 493          struct uid_map *new_uid_map;
 494          uint32_t *old_to_newseq_map;
 495          unsigned int i, count;
 496   
 497          if (!t->appends_nonsorted)
 498                  return;
 499   
 500          /* first make a copy of the UIDs and map them to sequences */
 501          recs = array_get_modifiable(&t->appends, &count);
 502          i_assert(count > 0);
 503   
 504          new_uid_map = i_new(struct uid_map, count);
 505          for (i = 0; i < count; i++) {
 506                  new_uid_map[i].idx = i;
 507                  new_uid_map[i].uid = recs[i].uid;
 508          }
 509   
 510          /* now sort the UID map */
 511          qsort(new_uid_map, count, sizeof(*new_uid_map), uid_map_cmp);
 512   
 513          /* sort mail records */
 514          sorted_recs = i_new(struct mail_index_record, count);
 515          sorted_recs[0] = recs[new_uid_map[0].idx];
 516          for (i = 1; i < count; i++) {
 517                  sorted_recs[i] = recs[new_uid_map[i].idx];
 518                  if (sorted_recs[i].uid == sorted_recs[i-1].uid)
 519                          i_panic("Duplicate UIDs added in transaction");
 520          }
 521          buffer_write(t->appends.arr.buffer, 0, sorted_recs,
 522                       sizeof(*sorted_recs) * count);
 523          i_free(sorted_recs);
 524   
 525          old_to_newseq_map = i_new(uint32_t, count);
 526          for (i = 0; i < count; i++)
 527                  old_to_newseq_map[new_uid_map[i].idx] = i + t->first_new_seq;
 528          i_free(new_uid_map);
 529   
 530          mail_index_transaction_sort_appends_ext(t, old_to_newseq_map);
 531          mail_index_transaction_sort_appends_keywords(t, old_to_newseq_map);
 532          i_free(old_to_newseq_map);
 533   
 534          t->appends_nonsorted = FALSE;
 535  }
Show more  




Change Warning 7240.24629 : Unreachable Call

Priority:
State:
Finding:
Owner:
Note: