diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-09-28 21:25:20 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-09-28 21:25:20 +0000 |
commit | ddd06f537235203ce3e9f7a2a5e454410317995c (patch) | |
tree | c312f5f6a11f323dc9f8d70c8f1604219de561bb /libgo/runtime/go-make-slice.c | |
parent | e78410bf1198e3ce4a37678c991821359b0fde79 (diff) | |
download | gcc-ddd06f537235203ce3e9f7a2a5e454410317995c.zip gcc-ddd06f537235203ce3e9f7a2a5e454410317995c.tar.gz gcc-ddd06f537235203ce3e9f7a2a5e454410317995c.tar.bz2 |
runtime: Better detection of memory allocation request overflow.
From-SVN: r191841
Diffstat (limited to 'libgo/runtime/go-make-slice.c')
-rw-r--r-- | libgo/runtime/go-make-slice.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/runtime/go-make-slice.c b/libgo/runtime/go-make-slice.c index 42b412c..822c9b6 100644 --- a/libgo/runtime/go-make-slice.c +++ b/libgo/runtime/go-make-slice.c @@ -37,7 +37,7 @@ __go_make_slice2 (const struct __go_type_descriptor *td, uintptr_t len, if (cap < len || (uintptr_t) icap != cap || (std->__element_type->__size > 0 - && cap > (uintptr_t) -1U / std->__element_type->__size)) + && cap > MaxMem / std->__element_type->__size)) runtime_panicstring ("makeslice: cap out of range"); ret.__count = ilen; |