Text   |  XML   |  ReML   |   Visible Warnings:

Unreasonable Size Argument  at buffer.c:255

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

mbox_sync_update_line

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/mbox/mbox-sync-update.c)expand/collapse
Show more  
 287  static void mbox_sync_update_line(struct mbox_sync_mail_context *ctx,
 288                                    size_t pos, string_t *new_line)
 289  {
 290          const char *hdr, *p;
 291          uoff_t file_pos;
 292   
 293          if (ctx->header_first_change > pos)
 294                  ctx->header_first_change = pos;
 295   
 296          /* set p = end of header, handle also wrapped headers */
 297          hdr = p = str_c(ctx->header) + pos;
 298          for (;;) {
 299                  p = strchr(p, '\n');
 300                  if (p == NULL) {
 301                          /* shouldn't really happen, but allow anyway.. */
 302                          p = hdr + strlen(hdr);
 303                          break;
 304                  }
 305                  if (p[1] != '\t' && p[1] != ' ')
 306                          break;
 307                  p += 2;
 308          }
 309   
 310          file_pos = pos + ctx->hdr_offset;
 311          if (ctx->mail.space > 0 && ctx->mail.offset >= file_pos &&
 312              ctx->mail.offset < file_pos + (p - hdr)) {
 313                  /* extra space points to this line. remove it. */
 314                  ctx->mail.offset = ctx->hdr_offset;
 315                  ctx->mail.space = 0;
 316          }
 317   
 318          mbox_sync_move_buffer(ctx, pos, str_len(new_line), p - hdr + 1);
 319[+]         buffer_copy(ctx->header, pos, new_line, 0, (size_t)-1);
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);
 253          } else {
 254                  memcpy(dest->w_buffer + dest_pos,
 255                         src->r_buffer + src_pos, copy_size);
Show more  
Show more  




Change Warning 7403.24569 : Unreasonable Size Argument

Priority:
State:
Finding:
Owner:
Note: