Text   |  XML   |  ReML   |   Visible Warnings:

Unreasonable Size Argument  at buffer.c:252

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

log_buffer_move_to_memory

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log-append.c)expand/collapse
Show more  
 71  static int log_buffer_move_to_memory(struct log_append_context *ctx)
 72  {
 73          struct mail_transaction_log_file *file = ctx->file;
 74   
 75          /* first we need to truncate this latest write so that log syncing
 76             doesn't break */
 77          if (ftruncate(file->fd, file->sync_offset) < 0) {
 78                  mail_index_file_set_syscall_error(file->log->index,
 79                                                    file->filepath,
 80                                                    "ftruncate()");
 81          }
 82   
 83[+]         if (mail_index_move_to_memory(file->log->index) < 0)
 84                  return -1;
 85          i_assert(MAIL_TRANSACTION_LOG_FILE_IN_MEMORY(file));
 86   
 87          i_assert(file->buffer_offset + file->buffer->used ==
 88                   file->sync_offset);
 89[+]         buffer_append_buf(file->buffer, ctx->output, 0, (size_t)-1);
expand/collapse

buffer_append_buf

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/buffer.c)expand/collapse
Show more  
 259  void buffer_append_buf(buffer_t *dest, const buffer_t *src,
 260                         size_t src_pos, size_t copy_size)
 261  {
 262[+]         buffer_copy(dest, dest->used, src, src_pos, copy_size);
expand/collapse

buffer_copy

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/buffer.c)expand/collapse
Show more  
 236  void buffer_copy(buffer_t *_dest, size_t dest_pos,
 237                   const buffer_t *_src, size_t src_pos, size_t copy_size)
 238  {
 239          struct real_buffer *dest = (struct real_buffer *)_dest;
 240          const struct real_buffer *src = (const struct real_buffer *)_src;
 241          size_t max_size;
 242   
 243          i_assert(src_pos <= src->used);
 244   
 245          max_size = src->used - src_pos;
 246          if (copy_size > max_size)
 247                  copy_size = max_size;
 248   
 249          buffer_check_limits(dest, dest_pos, copy_size);
 250          if (src == dest) {
 251                  memmove(dest->w_buffer + dest_pos,
 252                          src->r_buffer + src_pos, copy_size);
Show more  
Show more  
Show more  




Change Warning 7242.25670 : Unreasonable Size Argument

Priority:
State:
Finding:
Owner:
Note: