Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at mail-index-view-sync.c:303

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

view_sync_update_keywords

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-view-sync.c)expand/collapse
Show more  
 286  static int view_sync_update_keywords(struct mail_index_view_sync_ctx *ctx,
 287                                       uint32_t uid)
 288  {
 289          struct mail_transaction_header thdr;
 290          struct mail_transaction_keyword_update kw_up;
 291          const unsigned int *kw_idx;
 292          const char *const *kw_names;
 293          unsigned int i, count;
 294   
 295          kw_idx = array_get(&ctx->lost_new_kw, &count);
 296          if (count == 0)
 297                  return 0;
 298          kw_names = array_idx(&ctx->view->index->keywords, 0);
 299   
 300          memset(&thdr, 0, sizeof(thdr));
 301          thdr.type = MAIL_TRANSACTION_KEYWORD_UPDATE | MAIL_TRANSACTION_EXTERNAL;
 302          memset(&kw_up, 0, sizeof(kw_up));
 303          kw_up.modify_type = MODIFY_ADD;
 304          /* add new flags one by one */
 305          for (i = 0; i < count; i++) {
 306                  kw_up.name_size = strlen(kw_names[kw_idx[i]]);
 307                  buffer_set_used_size(ctx->lost_kw_buf, 0);
 308                  buffer_append(ctx->lost_kw_buf, &kw_up, sizeof(kw_up));
 309                  buffer_append(ctx->lost_kw_buf, kw_names[kw_idx[i]],
 310                                kw_up.name_size);
 311                  if (ctx->lost_kw_buf->used % 4 != 0) {
 312                          buffer_append_zero(ctx->lost_kw_buf,
 313                                             4 - ctx->lost_kw_buf->used % 4);
 314                  }
 315                  buffer_append(ctx->lost_kw_buf, &uid, sizeof(uid));
 316                  buffer_append(ctx->lost_kw_buf, &uid, sizeof(uid));
 317   
 318                  thdr.size = ctx->lost_kw_buf->used;
 319                  if (mail_index_sync_record(&ctx->sync_map_ctx, &thdr,
 320                                             ctx->lost_kw_buf->data) < 0)
 321                          return -1;
 322          }
 323          return 0;
 324  }
Show more  




Change Warning 7261.25797 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: