Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at mempool-alloconly.c:358

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

pool_alloconly_realloc

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/mempool-alloconly.c)expand/collapse
Show more  
 337  static void *pool_alloconly_realloc(pool_t pool, void *mem,
 338                                      size_t old_size, size_t new_size)
 339  {
 340          struct alloconly_pool *apool = (struct alloconly_pool *)pool;
 341          unsigned char *new_mem;
 342   
 343          if (unlikely(new_size == 0 || new_size > SSIZE_T_MAX))
 344                  i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
 345   
 346          if (mem == NULL)
 347                  return pool_alloconly_malloc(pool, new_size);
 348   
 349          if (new_size <= old_size)
 350                  return mem;
 351   
 352          new_size = MEM_ALIGN(new_size);
 353   
 354          /* see if we can directly grow it */
 355[+]         if (!pool_try_grow(apool, mem, new_size)) {
 356                  /* slow way - allocate + copy */
 357[+]                 new_mem = pool_alloconly_malloc(pool, new_size);
 358                  memcpy(new_mem, mem, old_size);
Show more  




Change Warning 7112.24566 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: