Repository : ssh://[email protected]/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1ce65edbff90fc8103062a1f94258ecc0c682309/ghc
>--------------------------------------------------------------- commit 1ce65edbff90fc8103062a1f94258ecc0c682309 Author: Reid Barton <[email protected]> Date: Wed Aug 28 17:13:21 2013 -0400 Paranoid integer overflow check in my_mmap Signed-off-by: Austin Seipp <[email protected]> >--------------------------------------------------------------- 1ce65edbff90fc8103062a1f94258ecc0c682309 rts/posix/OSMem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c index 000ad63..cbc76f8 100644 --- a/rts/posix/OSMem.c +++ b/rts/posix/OSMem.c @@ -79,6 +79,9 @@ my_mmap (void *addr, W_ size) { void *ret; + if (size > (W_)SIZE_MAX) + barf("my_mmap: impossibly large allocation of %" FMT_Word " bytes; W_ larger than size_t?", size); + #if defined(solaris2_HOST_OS) || defined(irix_HOST_OS) { int fd = open("/dev/zero",O_RDONLY); _______________________________________________ ghc-commits mailing list [email protected] http://www.haskell.org/mailman/listinfo/ghc-commits
