Re: gtk_file_chooser page faults (win32)



On Sat, Aug 14, 2004 at 01:49:34AM +0000, Tor Lillqvist wrote:
David writes:
 > THAT'S IT!!!!!!!!!!
 > 
 > I set HOME to a value and sure enough, it works!  I then went into msys
 > and unset HOME and it crashed the same way.

g_get_home_dir() can return NULL on Unix, too, if for some reason
there is no passwd entry for the user. Not that common, true, but can
easily happen for instance if you name service (like NIS+, NIS or
LDAP) is temporarily down. But anyway, one should always check for
NULL return value from it. I now notice that gtkfilesystemwin32.c
doesn't check ... Will have to fix.

Yes, anything that will allow a segfault is definitely bad.. Even if it
is user error (in this case).  Of course the flaw needs to be fixed, but,
perhaps there might be a need to warn users with systems like this that
they need a HOME environment variable?  AIUI, later versions of Windows
don't have this problem, but older systems like mine apparently don't
have a HOME set by default.  Or this is the way I understand it.

 > I didn't try it, but I'm confident that if I unset HOME in Linux, the
 > program would crash as well.

Presumably not, as the environment variable HOME is used only if no
passwd entry is found. You would have to make getpwuid(getuid()) fail,
too.

That's correct.  I just tried it before reading this part.  Then it
definitely is a Windows problem.



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