Fix for critical bug in glib-1.2.8 on Dec alpha OSF

testglib crashes in all cases (glib 1.2.1 -> 1.2.8) on Dec alpha osf v4.0f
right after printing "cwd: ....". Also, gtk+ crashes during memory allocation
in XOpenDisplay.

The problem is due to a broken getpwuid_r on Dec alpha osf v4.0f. It is called
with an initial buffer size of 64 in gutils.c function "static void g_get_any_init (void)"
Rather than returning an error and setting errno, the getpwuid_r happily writes
beyond the end of the allocated buffer. This causes a crash lateron, when new memory
is allocated.

The man page for getpwuid_r states that a minimal buffer size of 1024 is required.
So setting "guint bufsize = 1024;" resolves this problem.


R. A. Hogendoorn                                       E-mail:
Information and Communication Technology Division      Tel. +31-527-24-8367 
National Aerospace Laboratory, The Netherlands         Fax. +31-527-24-8210 

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