]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__nscd_gethostbyaddr_r): Follow change from 1999-07-17 and adjust len
authorUlrich Drepper <drepper@redhat.com>
Mon, 27 Sep 1999 00:15:44 +0000 (00:15 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 27 Sep 1999 00:15:44 +0000 (00:15 +0000)
parameter.

nscd/nscd_gethst_r.c
nscd/nscd_proto.h

index cb8f62e6963225ed8a385f890414d1e939fa67d1..c4ab3642c5b991a694f0f81cb34d4211bf7c1169 100644 (file)
@@ -67,7 +67,7 @@ __nscd_gethostbyname2_r (const char *name, int af, struct hostent *resultbuf,
 
 
 int
-__nscd_gethostbyaddr_r (const char *addr, int len, int type,
+__nscd_gethostbyaddr_r (const char *addr, size_t len, int type,
                        struct hostent *resultbuf, char *buffer, size_t buflen,
                        int *h_errnop)
 {
@@ -182,7 +182,7 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
       align2 = ((__alignof__ (char *) - ((cp + align1 + hst_resp.h_name_len)
                                         - ((char *) 0)))
                & (__alignof__ (char *) - 1));
-      if (buflen < (align1 + hst_resp.h_name_len + align2 +
+      if (buflen < (align1 + hst_resp.h_name_len + align2
                    + ((hst_resp.h_aliases_cnt + hst_resp.h_addr_list_cnt + 2)
                       * sizeof (char *))
                    + hst_resp.h_addr_list_cnt * (type == AF_INET
index 760b57de76e924a596b82bf306d8b3b6be8b9c1a..d9b92bf06680aa2f3aa12db6af3fe166fd37ccf4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@uni-paderborn.de>, 1998.
 
@@ -45,7 +45,7 @@ extern int __nscd_gethostbyname2_r __P ((const char *name, int af,
                                         struct hostent *resultbuf,
                                         char *buffer, size_t buflen,
                                         int *h_errnop));
-extern int __nscd_gethostbyaddr_r __P ((const char *addr, int len, int type,
+extern int __nscd_gethostbyaddr_r __P ((const char *addr, size_t len, int type,
                                        struct hostent *resultbuf,
                                        char *buffer, size_t buflen,
                                        int *h_errnop));