Go to the FreeLists Home Page Home Signup Help Login
 



[openbeosnetteam] || [Date Prev] [02-2004 Date Index] [Date Next] || [Thread Prev] [02-2004 Thread Index] [Thread Next]

[openbeosnetteam] Fix for resolving host names

  • From: Brennan Cleveland <warriorspot@xxxxxxxxxxxxx>
  • To: openbeosnetteam@xxxxxxxxxxxxx
  • Date: Sun, 1 Feb 2004 20:04:36 -0600
Team,

I fixed the issue with segmentation violations when resolving hostnames to IP addresses using /etc/hosts. However, I don't really know if it is a proper fix. As you know, only the first line of /etc/hosts would work. If the host name was on any line after 1, or was not in /etc/hosts, or if /etc/hosts did not exist, you would get a segmentation violation. After much hunting around and dead ends, I found that adding the following line to the gethostbyname(const char *name) function in gethostnamadr.c as the first executable line of code seems to fix the issue:

h_errno = (int *)malloc(sizeof(int));

If you agree this is an actual fix, and not a workaround for a larger problem that I'm not seeing, go ahead and submit it.

Thanks,

Brennan






[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.