BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000649 [uClibc] Standards Compliance major always 01-19-06 05:31 06-03-08 12:11
Reporter sluo View Status public  
Assigned To uClibc
Priority normal Resolution open  
Status assigned   Product Version 0.9.28
Summary 0000649: __heap_alloc_at can't find expected free area
Description The 35th line of libc\stdlib\malloc\heap_alloc_at.c should be
  if (fa_mem >= mem)
not
  if (fa_mem <= mem)
.
Only at a higher location can we break the for-loop.
Additional Information
Attached Files

- Relationships

- Notes
(0008104)
vda
06-03-08 12:11

Code is:

size_t
__heap_alloc_at (struct heap *heap, void *mem, size_t size)
{
  struct heap_free_area *fa;
  size_t alloced = 0;
  size = HEAP_ADJUST_SIZE (size);
  /* Look for a free area that can contain SIZE bytes. */
  for (fa = heap->free_areas; fa; fa = fa->next) {
      void *fa_mem = HEAP_FREE_AREA_START (fa);
      if (fa_mem <= mem) {
          if (fa_mem == mem && fa->size >= size)
            /* FA has the right addr, and is big enough! */
            alloced = __heap_free_area_alloc (heap, fa, size);
          break;
        }
    }
  return alloced;
}

I don't see off-hand why it should be "if (fa_mem >= mem)"...
 

- Issue History
Date Modified Username Field Change
01-19-06 05:31 sluo New Issue
01-19-06 05:31 sluo Status new => assigned
01-19-06 05:31 sluo Assigned To  => uClibc
06-03-08 12:11 vda Note Added: 0008104


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker