bug-gnulib
[Top][All Lists]
Advanced

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

Re: getaddrinfo: fix crash on IRIX


From: Simon Josefsson
Subject: Re: getaddrinfo: fix crash on IRIX
Date: Mon, 26 Mar 2007 10:34:07 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Hi Simon,
>
> On IRIX 6.5, the replacement getaddrinfo is used, and since the testsuite
> exercises calling it will a hints = NULL pointer, it crashes in line 182.
>
> Here is a proposed patch.

Hi Bruno.  It looks fine, please install.

/Simon

>
> 2007-03-25  Bruno Haible  <address@hidden>
>
>       * lib/getaddrinfo.c (getaddrinfo): Don't access hints->ai_flags when
>       hints is NULL.
>
> --- lib/getaddrinfo.c 21 Feb 2007 02:19:34 -0000      1.22
> +++ lib/getaddrinfo.c 25 Mar 2007 22:03:03 -0000
> @@ -179,7 +179,7 @@
>        const char *proto =
>       (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
>  
> -      if (!(hints->ai_flags & AI_NUMERICSERV))
> +      if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV))
>       /* FIXME: Use getservbyname_r if available. */
>       se = getservbyname (servname, proto);
>  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]