Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at mempool-alloconly.c:262

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

block_alloc

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/mempool-alloconly.c)expand/collapse
Show more  
 229  static void block_alloc(struct alloconly_pool *apool, size_t size)
 230  {
 231          struct pool_block *block;
 232   
 233          i_assert(size > SIZEOF_POOLBLOCK);
 234   
 235          if (apool->block != NULL) {
 236                  /* each block is at least twice the size of the previous one */
 237                  if (size <= apool->block->size)
 238                          size += apool->block->size;
 239   
 240[+]                 size = nearest_power(size);
 241  #ifdef DEBUG 
 242                  if (!apool->disable_warning) {
 243                          /* i_warning() overwrites unallocated data in data 
 244                             stack, so make sure everything is allocated before 
 245                             calling it. */
 246                          t_buffer_alloc_last_full();
 247                          i_warning("Growing pool '%s' with: %"PRIuSIZE_T,
 248                                    apool->name, size);
 249                  }
 250  #endif
 251          }
 252   
 253  #ifndef USE_GC 
 254          block = calloc(size, 1);
 255  #else
 256          block = GC_malloc(size);
 257  #endif
 258          if (unlikely(block == NULL)) {
 259                  i_fatal_status(FATAL_OUTOFMEM, "block_alloc(%"PRIuSIZE_T
 260                                 "): Out of memory", size);
 261          }
 262          block->prev = apool->block;
Show more  




Change Warning 7047.24450 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: