Skip to Content.
Sympa Menu

freetds - [freetds] Lookup error

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO Frediano" <Frediano.Ziglio AT vodafone.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Lookup error
  • Date: Tue, 7 Oct 2003 17:44:24 +0200

Inside tds_lookup_host there is a strange bug. Assuming we want to
resolve "Idontexist" name:
- inet_addr return INADDR_NONE
- tds_gethostbyname_r return NULL
- we scan invalid "Idontexist" string with sscanf without testing result
- we call tds_gethostbyaddr_r with garbage data, return NULL
I don't understand why we try to do a reverse lookup is host is not
resolved...
Also something tds_gethostbyaddr_r return no-NULL hostent* but no
address so inet_ntoa crash trying to defer a NULL pointer.
inet_ntoa is not thread-safe, we should use inet_ntop if available or
provide a replace.
gethostbyaddr_r is a very old interface, we should use getipnodebyaddr
or getaddrinfo if available (this will solve Mac OS X problem).

freddy77



  • [freetds] Lookup error, ZIGLIO Frediano, 10/07/2003

Archive powered by MHonArc 2.6.24.

Top of Page