HylaFAX The world's most advanced open source fax server

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

Bug in hfaxd.



	I'm using FreeBSD-2.2.1-RELEASE and hylafax-4.0p1.  This
doesn't have anything to do with the modem (and I can't really
identify it anyways).  The stock hfaxd program core dumps on FreeBSD
when invoked with the -i option, after someone connects or when
invoked with the -I option.  I've tracked down the offending
code... in the following code, hp turns up NULL for some reason.
Extending the if around the code solves the problem.

*** InetFaxServer.c++   Tue May 13 10:33:34 1997
--- InetFaxServer.orig  Tue May 13 10:34:05 1997
***************
*** 89,102 ****
      data_dest.sin_family = AF_INET;
  
      hostent* hp = Socket::gethostbyname(hostname);
-     /* added brackets DCLG */
      if (hp != NULL)
-     {
        hostname = hp->h_name;
!         struct in_addr in;
!         memcpy(&in, hp->h_addr, sizeof (in));
!         hostaddr = inet_ntoa(in);
!     }
  
      fxAssert(_instance == NULL,
        "Cannot create multiple InetFaxServer instances");
--- 89,99 ----
      data_dest.sin_family = AF_INET;
  
      hostent* hp = Socket::gethostbyname(hostname);
      if (hp != NULL)
        hostname = hp->h_name;
!     struct in_addr in;
!     memcpy(&in, hp->h_addr, sizeof (in));
!     hostaddr = inet_ntoa(in);
  
      fxAssert(_instance == NULL,
        "Cannot create multiple InetFaxServer instances");


Dave.

-- 
============================================================================
|David Gilbert, Velocet Communications.       | Two things can only be     |
|Mail:       dgilbert@velocet.net             |  equal if and only if they |
|http://www.velocet.net/~dgilbert             |   are precisely opposite.  |
=========================================================GLO================




Project hosted by iFAX Solutions