This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fix getpwuid_r() and getpwnam_r()


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]