Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at index-sort-string.c:456

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

index_sort_list_finish_string

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/index-sort-string.c)expand/collapse
Show more  
 782  void index_sort_list_finish_string(struct mail_search_sort_program *program)
 783  {
 784          struct sort_string_context *ctx = program->context;
 785          struct mail_sort_node *nodes;
 786          unsigned int i, count;
 787          uint32_t seq;
 788   
 789          nodes = array_get_modifiable(&ctx->nonzero_nodes, &count);
 790   
 791          static_zero_cmp_context = ctx;
 792[+]         if (array_count(&ctx->zero_nodes) == 0) {
 793                  /* fast path: we have all sort IDs */
 794                  qsort(nodes, count, sizeof(struct mail_sort_node),
 795                        sort_node_cmp);
 796   
 797                  if (!array_is_created(&program->seqs))
 798                          i_array_init(&program->seqs, count);
 799                  else 
 800                          array_clear(&program->seqs);
 801                  for (i = 0; i < count; i++) {
 802                          seq = nodes[i].seq;
 803                          array_append(&program->seqs, &seq, 1);
 804                  }
 805                  array_free(&ctx->nonzero_nodes);
 806          } else {
 807                  if (ctx->seqs_nonsorted) {
 808                          /* the nodes need to be sorted by sequence initially */
 809                          index_sort_nodes_by_seq(ctx);
 810                  }
 811   
 812                  /* we have to add some sort IDs. we'll do this for all
 813                     messages, so first remember what messages we wanted 
 814                     to know about. */
 815                  index_sort_generate_seqs(ctx);
 816                  /* add messages not in seqs list */
 817                  index_sort_add_missing(ctx);
 818                  /* sort all messages with sort IDs */
 819                  nodes = array_get_modifiable(&ctx->nonzero_nodes, &count);
 820                  qsort(nodes, count, sizeof(struct mail_sort_node),
 821                        sort_node_cmp);
 822                  for (;;) {
 823                          /* sort all messages without sort IDs */
 824[+]                         index_sort_zeroes(ctx);
 825   
 826                          if (ctx->reverse) {
 827                                  /* sort lists are descending currently, but 
 828                                     merging and sort ID assigning works only
 829                                     with ascending lists. reverse the lists 
 830                                     temporarily. we can't do this while earlier
 831                                     because secondary sort conditions must not 
 832                                     be reversed in results (but while assigning
 833                                     sort IDs it doesn't matter). */
 834                                  array_reverse(&ctx->nonzero_nodes);
 835                                  array_reverse(&ctx->zero_nodes);
 836                          }
 837   
 838                          /* merge zero and non-zero arrays into sorted_nodes */
 839[+]                         index_sort_merge(ctx);
expand/collapse

index_sort_merge

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/index-sort-string.c)expand/collapse
Show more  
 439  static void index_sort_merge(struct sort_string_context *ctx)
 440  {
 441          struct mail_sort_node *znodes, *nznodes;
 442          const char *zstr, *nzstr, *prev_str;
 443          unsigned int zpos, nzpos, nz_next_pos, zcount, nzcount;
 444          int ret;
 445   
 446          /* both zero_nodes and nonzero_nodes are sorted. we'll now just have 
 447             to merge them together. use sorted_nodes as the result array. */
 448          i_array_init(&ctx->sorted_nodes, array_count(&ctx->nonzero_nodes) +
 449                       array_count(&ctx->zero_nodes));
 450   
 451[+]         znodes = array_get_modifiable(&ctx->zero_nodes, &zcount);
 452          nznodes = array_get_modifiable(&ctx->nonzero_nodes, &nzcount);
 453   
 454          prev_str = NULL;
 455          for (zpos = nzpos = 0; zpos < zcount && nzpos < nzcount; ) {
 456                  zstr = ctx->sort_strings[znodes[zpos].seq];
Show more  
Show more  




Change Warning 11716.25706 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: