home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5912 < prev    next >
Encoding:
Text File  |  1992-09-13  |  1.1 KB  |  33 lines

  1. Path: sparky!uunet!sun-barr!olivea!news.bbn.com!testament.bbn.com!cjross
  2. From: cjross@bbn.com (Chris Ross)
  3. Newsgroups: comp.lang.perl
  4. Subject: gethostbyname() crash in pl 4.035 under SunOS 4.1.?
  5. Message-ID: <lb7s03INNjqt@news.bbn.com>
  6. Date: 14 Sep 92 01:50:59 GMT
  7. Reply-To: cjross@bbn.com (Chris Ross)
  8. Organization: Bolt Beranek and Newman Inc., Cambridge MA
  9. Lines: 21
  10. NNTP-Posting-Host: bbn.com
  11.  
  12.  
  13. doio.c, lines 1738-1744 read as follows:
  14.  
  15.         if (which == O_GHBYNAME) {
  16. #ifdef h_addr
  17.                 str_nset(str, *hent->h_addr, hent->h_length);
  18. #else
  19.                 str_nset(str, hent->h_addr, hent->h_length);
  20. #endif
  21.  
  22. Sun's <netdb.h> defines h_addr as
  23. #define h_addr    h_addr_list[0]    /* address, for backward compatiblity */
  24.  
  25. h_addr_list is dereferenced by both <netdb.h> and perl, which results
  26. in a char being passed to str_nset.  I've no idea which is at fault.
  27. The obvious quick fix works.
  28.  
  29.  
  30. chris ross   <cjross@bbn.com>   BBN Advanced Simulations   (617) 873-3272
  31.  WARNING: article may contain flammable material.  Do not expose to open
  32.    flames.  In case of accidental ignition, douse keyboard with water.
  33.