]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Wed, 1 Sep 2004 02:03:07 +0000 (02:03 +0000)
committerMark Andrews <marka@isc.org>
Wed, 1 Sep 2004 02:03:07 +0000 (02:03 +0000)
1682.   [bug]           gethostby*_r() implementations that copied the return
                        pointer got NULL returned on success.

lib/bind/irs/gethostent_r.c

index f7e99ec3257a34ef10c0333eadc7f708683c7a53..28f1a7f7cdfa71e36d493f56f0e22ba7765f4192 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: gethostent_r.c,v 1.4.206.2 2004/04/22 03:32:06 marka Exp $";
+static const char rcsid[] = "$Id: gethostent_r.c,v 1.4.206.3 2004/09/01 02:03:07 marka Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <port_before.h>
@@ -47,7 +47,7 @@ gethostbyname_r(const char *name,  struct hostent *hptr, HOST_R_ARGS) {
        HOST_R_ERRNO;
 
 #ifdef HOST_R_SETANSWER
-       if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) == 0)
+       if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
                *answerp = NULL;
        else
                *answerp = hptr;
@@ -72,7 +72,7 @@ gethostbyaddr_r(const char *addr, int len, int type,
        HOST_R_ERRNO;
 
 #ifdef HOST_R_SETANSWER
-       if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) == 0)
+       if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
                *answerp = NULL;
        else
                *answerp = hptr;
@@ -102,7 +102,7 @@ gethostent_r(struct hostent *hptr, HOST_R_ARGS) {
        HOST_R_ERRNO;
 
 #ifdef HOST_R_SETANSWER
-       if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) == 0)
+       if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
                *answerp = NULL;
        else
                *answerp = hptr;