This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug malloc/15857] New: posix_memalign / memalign integer overflow can corrupt allocator state


http://sourceware.org/bugzilla/show_bug.cgi?id=15857

            Bug ID: 15857
           Summary: posix_memalign / memalign integer overflow can corrupt
                    allocator state
           Product: glibc
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: malloc
          Assignee: unassigned at sourceware dot org
          Reporter: will.newton at gmail dot com

The following test case crashes when it should return ENOMEM:

#include <stdlib.h>
#include <malloc.h>
#include <unistd.h>

int main(void)
{
  void *memptr;
  unsigned long pagesize = getpagesize();

  posix_memalign(&memptr, pagesize, -pagesize);

  return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]