Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at strfuncs.c:39

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

dbox_index_append_commit_new

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/dbox/dbox-index.c)expand/collapse
Show more  
 799  static int dbox_index_append_commit_new(struct dbox_index_append_context *ctx,
 800                                          struct dbox_file *file, string_t *str)
 801  {
 802          struct mail_storage *storage = &ctx->index->mbox->storage->storage;
 803          struct dbox_index_record rec;
 804          struct stat st;
 805          unsigned int file_id;
 806   
 807          i_assert(file->append_count > 0);
 808   
 809          if (file->append_count == 1 && !file->maildir_file &&
 810              !dbox_file_can_append(file, 0)) {
 811                  /* single UID message file */
 812                  i_assert(file->last_append_uid != 0);
 813                  file_id = file->last_append_uid | DBOX_FILE_ID_FLAG_UID;
 814                  return dbox_file_assign_id(file, file_id);
 815          }
 816   
 817          if (!ctx->locked_header) {
 818                  if (dbox_index_lock_header(ctx->index) < 0)
 819                          return -1;
 820                  if (dbox_index_read_header(ctx->index) < 0) {
 821                          dbox_index_unlock_header(ctx->index);
 822                          return -1;
 823                  }
 824                  if (fstat(ctx->index->fd, &st) < 0) {
 825                          mail_storage_set_critical(storage,
 826                                  "fstat(%s) failed: %m", ctx->index->path);
 827                          dbox_index_unlock_header(ctx->index);
 828                          return -1;
 829                  }
 830                  ctx->output_offset = st.st_size;
 831                  ctx->new_record_idx = array_count(&ctx->index->records);
 832                  ctx->first_new_file_id = ctx->index->next_file_id;
 833                  ctx->locked_header = TRUE;
 834          }
 835   
 836          file_id = ctx->index->next_file_id++;
 837[+]         if (dbox_file_assign_id(file, file_id) < 0)
 838                  return -1;
 839   
 840          memset(&rec, 0, sizeof(rec));
 841          rec.file_id = file_id;
 842          rec.file_offset = ctx->output_offset + str_len(str);
 843          if (file->maildir_file) {
 844                  rec.status = DBOX_INDEX_FILE_STATUS_MAILDIR;
 845                  rec.data = p_strdup(ctx->index->record_data_pool,
 846[+][+]                                     dbox_file_maildir_get_index_data(file));
expand/collapse

p_strdup

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/strfuncs.c)expand/collapse
Show more  
 31  char *p_strdup(pool_t pool, const char *str)
 32  {
 33          void *mem;
 34          size_t len;
 35   
 36          if (str == NULL)
 37                  return NULL;
 38   
 39          for (len = 0; (str)[len] != '\0'; )
 40                  len++;
Show more  
Show more  




Change Warning 7456.25577 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: