VirtualBox

Ignore:
Timestamp:
Jun 24, 2013 3:44:55 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
86686
Message:

Devices/Input/UsbMouse: add basic unit test harness.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_dns.c

    r44529 r46758  
    2727#define isdigit(ch)    RT_C_IS_DIGIT(ch)
    2828#define isalpha(ch)    RT_C_IS_ALPHA(ch)
     29
    2930
    3031#define DNS_CONTROL_PORT_NUMBER 53
     
    197198    /* Parse dns request */
    198199    char *qw_qname = NULL;
    199     struct hostent *pHostent = NULL;
     200    struct {
     201        struct hostent hostnt;
     202        char buffer[1024];
     203    } hostent_with_buffer;
     204    struct hostent *pHostent = &hostent_with_buffer.hostnt;
     205    int rc_hostent = 0;
     206    int h_errnop = 0;
     207
    200208    char pszCname[255];
    201209    int cname_len = 0;
     
    245253            pszCname[cname_len - 2] = 0;
    246254        }
    247         pHostent = gethostbyname(pszCname);
     255        rc_hostent = gethostbyname_r(pszCname,
     256                                     &hostent_with_buffer.hostnt,
     257                                     hostent_with_buffer.buffer,
     258                                     1024,
     259                                     &pHostent,
     260                                     &h_errnop);
     261        /* Expected rc_hostent equals to 0, if not 0 and h_errnop == ERANGE
     262         * we need to alloc more memory, for buffer.
     263         */
     264        if (rc_hostent)
     265            return 1;
    248266#ifdef VBOX_WITH_DNSMAPPING_IN_HOSTRESOLVER
    249267        if (   pHostent
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette