Message ID | mcr7gdkd471.fsf@iant-glaptop.roam.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r cdf7917ba5bf libgo/runtime/go-make-slice.c --- a/libgo/runtime/go-make-slice.c Wed Oct 09 20:50:33 2013 -0700 +++ b/libgo/runtime/go-make-slice.c Thu Oct 10 17:44:40 2013 -0700 @@ -34,7 +34,10 @@ std = (const struct __go_slice_type *) td; ilen = (intgo) len; - if (ilen < 0 || (uintptr_t) ilen != len) + if (ilen < 0 + || (uintptr_t) ilen != len + || (std->__element_type->__size > 0 + && len > MaxMem / std->__element_type->__size)) runtime_panicstring ("makeslice: len out of range"); icap = (intgo) cap;