still a bug with getpwuid_r [was: Re: 1.1.14 and a lot of core dumps]




It now looks like this in the CVS:

 guint bufsize = 64;

I'm not convinced that this is correct. The buffer should be big
enough to hold the largest entry in /etc/passwd.

The Digital Unix man page states:

[Digital]  The minimum buffer size is 1024 bytes as defined for
            SIABUFSIZ in /usr/include/sia.h.

As 64 < 1024 we appear to have a problem.

-tony


On 02-Feb-99 Dave Reed wrote:
> 
> I haven't checked whether this is fixed in CVS, but in case it
> isn't,
> yes, this does seem to be a bug in 1.1.14.  I have a simple gtk app
> that crashed in gtk_init because of this - nothing else was called
> before it.  testgtk worked fine, but my simple program didn't.  The
> patch below fixed it so hopefully it will be in 1.1.15.
> 
> Dave
> 
> 
>> From: Bernd Senf <bsenf@imb-jena.de>
>> > 
>> > (A wild guess might be that you are calling free() on the
>> > results of gtk_entry_get_text(). That function just returns
>> > a pointer to the internal data and doesn't make a copy -
>> > and never has)
>> > 
>> I have alse installed Version 1.1.14 and got some core in the base
>> examples "base" and "filesel", but not in "testgtk".
>> 
>> I have found this patch within this news-list and now it works:
>> 
>> (Also reported from Ben Gertzfield <che@debian.org> and Havoc
>> Pennington <hp@Jupiter.mcs.net> a few days ago):
>> 
>> 
>> --- gutils.c.orig       Thu Jan 28 23:25:19 1999
>> +++ gutils.c    Thu Jan 28 23:25:34 1999
>> @@ -443,7 +443,7 @@
>>  
>>  #  ifdef HAVE_GETPWUID_R
>>          struct passwd pwd;
>> -        guint bufsize = 1; /* sizeof (struct passwd); */
>> +        guint bufsize = sizeof (struct passwd);
>>          gint error;
>> 
>> 
>> Maybe this will solve the same problem.
>> (glib 1.1.14, gtk+ 1.1.14, HPUX 10.20)
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
> /dev/null

---
E-Mail: trog@gtk.org
Love America -- or give it back.

Go Bezerk! http://www.gtk.org/~trog



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]