Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread Peter Rosin
On 2014-05-25 00:00, David Stacey wrote: In function cygwin_rexec(), a pointer to local buffer 'ahostbuf' is returned through 'ahost'. However, the buffer will have been deallocated at the end of the function, and so the contents of 'ahost' will be undefined. A trivial patch (attached)

Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread David Stacey
On 26/05/14 08:04, Peter Rosin wrote: On 2014-05-25 00:00, David Stacey wrote: In function cygwin_rexec(), a pointer to local buffer 'ahostbuf' is returned through 'ahost'. However, the buffer will have been deallocated at the end of the function, and so the contents of 'ahost' will be

Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread Peter Rosin
On 2014-05-26 12:09, David Stacey wrote: On 26/05/14 08:04, Peter Rosin wrote: On 2014-05-25 00:00, David Stacey wrote: In function cygwin_rexec(), a pointer to local buffer 'ahostbuf' is returned through 'ahost'. However, the buffer will have been deallocated at the end of the function,

Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread David Stacey
On 26/05/14 14:36, Peter Rosin wrote: I believe the comment refers to if static is the right answer to the problem. Is there a need to handle concurrent calls? I can't really comment on that. As the code stands, neither of the two functions that we are discussing are reentrant. As long as the

Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread Christopher Faylor
On Mon, May 26, 2014 at 04:27:10PM +0100, David Stacey wrote: On 26/05/14 14:36, Peter Rosin wrote: I believe the comment refers to if static is the right answer to the problem. Is there a need to handle concurrent calls? I can't really comment on that. As the code stands, neither of the two

Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread Peter Rosin
On 2014-05-26 18:35, Christopher Faylor wrote: On Mon, May 26, 2014 at 04:27:10PM +0100, David Stacey wrote: On 26/05/14 14:36, Peter Rosin wrote: I believe the comment refers to if static is the right answer to the problem. Is there a need to handle concurrent calls? I can't really comment

Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread Christopher Faylor
On Mon, May 26, 2014 at 10:39:03PM +0200, Peter Rosin wrote: On 2014-05-26 18:35, Christopher Faylor wrote: On Mon, May 26, 2014 at 04:27:10PM +0100, David Stacey wrote: On 26/05/14 14:36, Peter Rosin wrote: I believe the comment refers to if static is the right answer to the problem. Is there

Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread Christopher Faylor
On Mon, May 26, 2014 at 05:40:49PM -0400, Christopher Faylor wrote: On Mon, May 26, 2014 at 10:39:03PM +0200, Peter Rosin wrote: On 2014-05-26 18:35, Christopher Faylor wrote: On Mon, May 26, 2014 at 04:27:10PM +0100, David Stacey wrote: On 26/05/14 14:36, Peter Rosin wrote: I believe the

Re: [PATCH] cygwin_rexec() returns pointer to deallocated memory

2014-05-26 Thread Christopher Faylor
On Mon, May 26, 2014 at 05:46:10PM -0400, Christopher Faylor wrote: Btw, the latest version of freebsd can't have this particular problem since ahostbuf is now gone. We probably should pull in the latest version into Cygwin's tree. ...and that's apparently because Corinna added the code in