Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at array.h:171

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

virtual_sync_backend_add_new

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/virtual/virtual-sync.c)expand/collapse
Show more  
 1196  static void virtual_sync_backend_add_new(struct virtual_sync_context *ctx)
 1197  {
 1198          uint32_t virtual_ext_id = ctx->mbox->virtual_ext_id;
 1199          struct virtual_add_record *adds;
 1200          struct virtual_backend_box *bbox;
 1201          struct virtual_backend_uidmap *uidmap;
 1202          const struct mail_index_header *hdr;
 1203          const struct virtual_mail_index_record *vrec;
 1204          unsigned int i, count, idx, uid_count;
 1205          uint32_t vseq, first_uid, next_uid;
 1206   
 1207          hdr = mail_index_get_header(ctx->sync_view);
 1208[+]         adds = array_get_modifiable(&ctx->all_adds, &count);
 1209          if (count == 0) {
 1210                  ctx->mbox->sync_virtual_next_uid = hdr->next_uid;
 1211                  return;
 1212          }
 1213   
 1214          if (adds[0].rec.mailbox_id == adds[count-1].rec.mailbox_id) {
 1215                  /* all messages are from a single mailbox. add them in 
 1216                     the same order. */
 1217          } else {
 1218                  /* sort new messages by received date to get the add order */
 1219                  virtual_sync_backend_sort_new(ctx);
 1220          }
 1221   
 1222          for (bbox = NULL, i = 0; i < count; i++) {
 1223                  vrec = &adds[i].rec;
 1224                  if (bbox == NULL || bbox->mailbox_id != vrec->mailbox_id) {
 1225                          bbox = virtual_backend_box_lookup(ctx->mbox,
 1226                                                            vrec->mailbox_id);
 1227                  }
 1228   
 1229                  mail_index_append(ctx->trans, 0, &vseq);
 1230                  mail_index_update_ext(ctx->trans, vseq, virtual_ext_id,
 1231                                        vrec, NULL);
 1232                  virtual_sync_external_flags(ctx, bbox, vseq, vrec->real_uid);
 1233          }
 1234   
 1235          /* assign UIDs to new messages */
 1236          first_uid = hdr->next_uid;
 1237          mail_index_append_assign_uids(ctx->trans, first_uid, &next_uid);
 1238   
 1239          /* update virtual UIDs in uidmap */
 1240          for (bbox = NULL, i = 0; i < count; i++) {
 1241                  vrec = &adds[i].rec;
 1242                  if (bbox == NULL || bbox->mailbox_id != vrec->mailbox_id) {
 1243                          bbox = virtual_backend_box_lookup(ctx->mbox,
 1244[+]                                                           vrec->mailbox_id);
 1245                  }
 1246   
 1247[+]                 uidmap = array_get_modifiable(&bbox->uids, &uid_count);
expand/collapse

array_get_modifiable_i

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h)expand/collapse
Show more  
 168  static inline void *
 169  array_get_modifiable_i(struct array *array, unsigned int *count_r)
 170  {
 171          *count_r = array->buffer->used / array->element_size;
Show more  
 1248                  if (!bsearch_insert_pos(&vrec->real_uid, uidmap, uid_count,
 1249                                          sizeof(*uidmap),
 1250                                          virtual_backend_uidmap_bsearch_cmp,
 1251                                          &idx))
 1252                          i_unreached();
 1253                  i_assert(uidmap[idx].virtual_uid == 0);
 1254                  uidmap[idx].virtual_uid = first_uid + i;
Show more  




Change Warning 8160.24714 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: