Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-06-16 Thread Bernhard Reutner-Fischer
On 16 June 2014 09:39, Janne Blomqvist wrote: > On Mon, Jun 16, 2014 at 10:01 AM, Bernhard Reutner-Fischer > wrote: >> On 16 June 2014 08:20:09 Janne Blomqvist wrote: >> >>> On Sun, Jun 15, 2014 at 8:23 AM, Bernhard Reutner-Fischer >>> wrote: >>> > >>> >> >> On Tue, May 20, 2014 at 12:42 AM, Ja

Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-06-16 Thread Janne Blomqvist
On Mon, Jun 16, 2014 at 10:01 AM, Bernhard Reutner-Fischer wrote: > On 16 June 2014 08:20:09 Janne Blomqvist wrote: > >> On Sun, Jun 15, 2014 at 8:23 AM, Bernhard Reutner-Fischer >> wrote: >> > >> >> >> On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist >> >> >> wrote: >> >> >>> On Thu, May 15,

Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-06-16 Thread Bernhard Reutner-Fischer
On 16 June 2014 08:20:09 Janne Blomqvist wrote: On Sun, Jun 15, 2014 at 8:23 AM, Bernhard Reutner-Fischer wrote: > >> >> On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist >> >> wrote: >> >>> On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist >> >>> wrote: >> Hi, >> >> a common m

Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-06-15 Thread Janne Blomqvist
On Sun, Jun 15, 2014 at 8:23 AM, Bernhard Reutner-Fischer wrote: > >> >> On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist >> >> wrote: >> >>> On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist >> >>> wrote: >> Hi, >> >> a common malloc() pattern is "malloc(num_foo * sizeof(foo_t)",

Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-06-14 Thread Bernhard Reutner-Fischer
>> On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist >> wrote: >>> On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist >>> wrote: Hi, a common malloc() pattern is "malloc(num_foo * sizeof(foo_t)", that is, create space for an array of type foo_t with num_foo elements. The

Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-06-14 Thread Janne Blomqvist
PING #3 On Sat, Jun 7, 2014 at 5:46 AM, Janne Blomqvist wrote: > PING #2 > > On Fri, May 30, 2014 at 5:53 PM, Janne Blomqvist > wrote: >> PING >> >> On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist >> wrote: >>> On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist >>> wrote: Hi, a

Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-06-06 Thread Janne Blomqvist
PING #2 On Fri, May 30, 2014 at 5:53 PM, Janne Blomqvist wrote: > PING > > On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist > wrote: >> On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist >> wrote: >>> Hi, >>> >>> a common malloc() pattern is "malloc(num_foo * sizeof(foo_t)", that >>> is, create

Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-05-30 Thread Janne Blomqvist
PING On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist wrote: > On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist > wrote: >> Hi, >> >> a common malloc() pattern is "malloc(num_foo * sizeof(foo_t)", that >> is, create space for an array of type foo_t with num_foo elements. >> There is a slight da

Re: [PATCH, libgfortran] Add overflow check to xmalloc

2014-05-19 Thread Janne Blomqvist
On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist wrote: > Hi, > > a common malloc() pattern is "malloc(num_foo * sizeof(foo_t)", that > is, create space for an array of type foo_t with num_foo elements. > There is a slight danger here in that the multiplication can overflow > and wrap around, and

[PATCH, libgfortran] Add overflow check to xmalloc

2014-05-14 Thread Janne Blomqvist
Hi, a common malloc() pattern is "malloc(num_foo * sizeof(foo_t)", that is, create space for an array of type foo_t with num_foo elements. There is a slight danger here in that the multiplication can overflow and wrap around, and then the caller thinks it has a larger array than what malloc has ac