[PATCH] cygwin_rexec() returns pointer to deallocated memory
Christopher Faylor
cgf-use-the-mailinglist-please@cygwin.com
Mon May 26 16:35:00 GMT 2014
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
>functions that we are discussing are reentrant. As long as the author
>and the user(s) of the routines are both aware of that then it isn't a
>problem.
>
>I was just trying to fix a coding error that was picked up by Coverity
>Scan; it wasn't my intention to question the design.
But that is the usual problem with Coverity. Making the simple, obvious
fix to correct a Coverity warning isn't necessarily the right way to
deal with the issue.
In this case, the linux man page says:
ATTRIBUTES
Multithreading (see pthreads(7))
The rexec() and rexec_af() functions are not thread-safe.
so static is appropriate.
cgf
More information about the Cygwin-patches
mailing list