This is the mail archive of the cygwin@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: Heads up: *possible* bug in cygwin


On Wed, Jan 01, 2003 at 12:34:45PM -0500, Christopher Faylor wrote:
>On Wed, Jan 01, 2003 at 12:19:52PM -0500, Pierre A. Humblet wrote:
>>> On Wed, Jan 01, 2003 at 10:05:10AM +0000, Steven O'Brien wrote:
>>
>>> >In glib-1.2.10, gutils.c: g_get_any_init (void), the current user
>>> >details are obtained from /etc/passwd. This code is called as part of
>>> >glib initialisation, whether the app wants this data or not. It uses
>>> >sysconf (_SC_GETPW_R_SIZE_MAX) to decide how much buffer to allocate for
>>> >this data. But on cygwin this appears broken, and the call to getpwuid_r
>>> >(getuid (), &pwd, buffer, bufsize, &pw) *may* overrun buffer, depending
>>> >on the length of the line in /etc/passwd for the current user.
>>
>>Have you experienced an overrun? I see code in cygwin to set errno to 
>>ERANGE if the buffer is too small.
>
>Aha! There's the bug.  AFAICT, the size calculation is wrong.  It isn't
>taking the size of all of the elements into consideration.

I've uploaded a new snapshot which should correctly calculate the buffer
size for overflow conditions and returns a large number for
_SC_GETPW_R_SIZE_MAX

Building things with the new top-level configury in the gcc/binutils/gdb
tree is certainly a challenge now...

cgf
--
Please use the resources at cygwin.com rather than sending personal email.
Special for spam email harvesters: send email to aaaspam@sources.redhat.com
and be permanently blocked from mailing lists at sources.redhat.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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