This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: fix getpwuid_r() and getpwnam_r()
- From: "Pierre A. Humblet" <pierre at phumblet dot no-ip dot org>
- To: Radu Greab <rgreab at fx dot ro>
- Cc: cygwin-patches at cygwin dot com
- Date: Mon, 08 Sep 2003 17:59:40 -0400
- Subject: Re: fix getpwuid_r() and getpwnam_r()
- References: <20030909.003617.40718540.radu@primIT.ro>
- Reply-to: Pierre dot Humblet at ieee dot org
Radu Greab wrote:
>
> I have not rebuilt cygwin to test this patch, but I think that the
> problem and the fix are obvious: pw_comment is not returned or
> initialized by these reentrant functions. The problem was discovered
> when debugging a perl test failure on cygwin:
>
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-09/msg00500.html
>
> Thanks,
> Radu Greab
It's true that member "comment" should be initialized.
However it is always NULL in Cygwin, so your code is likely to crash.
Just set comment to NULL.
Pierre