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

2014-06-16 Thread Janne Blomqvist
On Sun, Jun 15, 2014 at 8:23 AM, Bernhard Reutner-Fischer rep.dot@gmail.com wrote: On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist blomqvist.ja...@gmail.com wrote: On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist blomqvist.ja...@gmail.com wrote: Hi, a common malloc() pattern

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

2014-06-16 Thread Bernhard Reutner-Fischer
On 16 June 2014 08:20:09 Janne Blomqvist blomqvist.ja...@gmail.com wrote: On Sun, Jun 15, 2014 at 8:23 AM, Bernhard Reutner-Fischer rep.dot@gmail.com wrote: On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist blomqvist.ja...@gmail.com wrote: On Thu, May 15, 2014 at 1:00 AM, Janne

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 rep.dot@gmail.com wrote: On 16 June 2014 08:20:09 Janne Blomqvist blomqvist.ja...@gmail.com wrote: On Sun, Jun 15, 2014 at 8:23 AM, Bernhard Reutner-Fischer rep.dot@gmail.com wrote: On Tue, May 20, 2014 at 12:42 AM, Janne

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

2014-06-16 Thread Bernhard Reutner-Fischer
On 16 June 2014 09:39, Janne Blomqvist blomqvist.ja...@gmail.com wrote: On Mon, Jun 16, 2014 at 10:01 AM, Bernhard Reutner-Fischer rep.dot@gmail.com wrote: On 16 June 2014 08:20:09 Janne Blomqvist blomqvist.ja...@gmail.com wrote: On Sun, Jun 15, 2014 at 8:23 AM, Bernhard Reutner-Fischer

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 blomqvist.ja...@gmail.com wrote: PING #2 On Fri, May 30, 2014 at 5:53 PM, Janne Blomqvist blomqvist.ja...@gmail.com wrote: PING On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist blomqvist.ja...@gmail.com wrote: On Thu, May 15, 2014

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 blomqvist.ja...@gmail.com wrote: On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist blomqvist.ja...@gmail.com 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

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 blomqvist.ja...@gmail.com wrote: PING On Tue, May 20, 2014 at 12:42 AM, Janne Blomqvist blomqvist.ja...@gmail.com wrote: On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist blomqvist.ja...@gmail.com wrote: Hi, a common malloc()

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 blomqvist.ja...@gmail.com wrote: On Thu, May 15, 2014 at 1:00 AM, Janne Blomqvist blomqvist.ja...@gmail.com 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

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 blomqvist.ja...@gmail.com 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

[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