~ubuntu-branches/ubuntu/lucid/curl/lucid-security

« back to all changes in this revision

Viewing changes to lib/hostip4.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-12-12 15:04:52 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20051212150452-2ymlra67b2p7kjyy
Tags: 7.15.1-1ubuntu1
Resynchronise with Debian to get URL parser overflow fix from 7.15.1
(CVE-2005-4077).

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: hostip4.c,v 1.16 2005/04/19 23:19:23 bagder Exp $
 
21
 * $Id: hostip4.c,v 1.19 2005/09/16 21:30:08 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
172
172
/*
173
173
 * Curl_getaddrinfo() - the ipv4 synchronous version.
174
174
 *
175
 
 * The original code to this function was once stolen from the Dancer source
176
 
 * code, written by Bjorn Reese, it has since been patched and modified
177
 
 * considerably.
 
175
 * The original code to this function was from the Dancer source code, written
 
176
 * by Bjorn Reese, it has since been patched and modified considerably.
178
177
 *
179
178
 * gethostbyname_r() is the thread-safe version of the gethostbyname()
180
179
 * function. When we build for plain IPv4, we attempt to use this
424
423
      prevai->ai_next = ai;
425
424
 
426
425
    ai->ai_family = AF_INET;              /* we only support this */
427
 
    ai->ai_socktype = SOCK_STREAM;        /* we only support this */
 
426
 
 
427
    /* we return all names as STREAM, so when using this address for TFTP
 
428
       the type must be ignored and conn->socktype be used instead! */
 
429
    ai->ai_socktype = SOCK_STREAM;
 
430
 
428
431
    ai->ai_addrlen = sizeof(struct sockaddr_in);
429
432
    /* make the ai_addr point to the address immediately following this struct
430
433
       and use that area to store the address */