Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at mail-index-sync.c:542

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

mail_index_sync_next

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-sync.c)expand/collapse
Show more  
 579  bool mail_index_sync_next(struct mail_index_sync_ctx *ctx,
 580                            struct mail_index_sync_rec *sync_rec)
 581  {
 582          struct mail_index_transaction *sync_trans = ctx->sync_trans;
 583          struct mail_index_sync_list *sync_list;
 584          const struct uid_range *uid_range = NULL;
 585          unsigned int i, count, next_i;
 586          uint32_t next_found_uid;
 587   
 588          next_i = (unsigned int)-1;
 589          next_found_uid = (uint32_t)-1;
 590   
 591          /* FIXME: replace with a priority queue so we don't have to go 
 592             through the whole list constantly. and remember to make sure that
 593             keyword resets are sent before adds! */
 594[+]         sync_list = array_get_modifiable(&ctx->sync_list, &count);
 595          for (i = 0; i < count; i++) {
 596                  if (!array_is_created(sync_list[i].array) ||
 597                      sync_list[i].idx == array_count(sync_list[i].array))
 598                          continue;
 599   
 600                  uid_range = array_idx(sync_list[i].array, sync_list[i].idx);
 601                  if (uid_range->uid1 == ctx->next_uid) {
 602                          /* use this one. */
 603                          break;
 604                  }
 605                  if (uid_range->uid1 < next_found_uid) {
 606                          next_i = i;
 607                          next_found_uid = uid_range->uid1;
 608                  }
 609          }
 610   
 611          if (i == count) {
 612                  if (next_i == (unsigned int)-1) {
 613                          /* nothing left in sync_list */
 614                          if (ctx->sync_appends) {
 615                                  ctx->sync_appends = FALSE;
 616                                  sync_rec->type = MAIL_INDEX_SYNC_TYPE_APPEND;
 617                                  sync_rec->uid1 = ctx->append_uid_first;
 618                                  sync_rec->uid2 = ctx->append_uid_last;
 619                                  return TRUE;
 620                          }
 621                          return FALSE;
 622                  }
 623                  ctx->next_uid = next_found_uid;
 624                  i = next_i;
 625                  uid_range = array_idx(sync_list[i].array, sync_list[i].idx);
 626          }
 627   
 628          if (sync_list[i].array == (void *)&sync_trans->expunges) {
 629                  mail_index_sync_get_expunge(sync_rec,
 630[+]                         (const struct mail_transaction_expunge *)uid_range);
expand/collapse

mail_index_sync_get_expunge

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-sync.c)expand/collapse
Show more  
 538  mail_index_sync_get_expunge(struct mail_index_sync_rec *rec,
 539                              const struct mail_transaction_expunge *exp)
 540  {
 541          rec->type = MAIL_INDEX_SYNC_TYPE_EXPUNGE;
 542          rec->uid1 = exp->uid1;
Show more  
Show more  




Change Warning 7256.24410 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: