bug-gnulib
[Top][All Lists]
Advanced

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

getaddrinfo: fix crash on IRIX


From: Bruno Haible
Subject: getaddrinfo: fix crash on IRIX
Date: Mon, 26 Mar 2007 00:03:43 +0200
User-agent: KMail/1.5.4

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.


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]