From 03350a54a8ccb33b2f07f173da01a17a469cf31d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 27 Sep 1999 00:15:44 +0000 Subject: [PATCH] (__nscd_gethostbyaddr_r): Follow change from 1999-07-17 and adjust len parameter. --- nscd/nscd_gethst_r.c | 4 ++-- nscd/nscd_proto.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c index cb8f62e6963..c4ab3642c5b 100644 --- a/nscd/nscd_gethst_r.c +++ b/nscd/nscd_gethst_r.c @@ -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 diff --git a/nscd/nscd_proto.h b/nscd/nscd_proto.h index 760b57de76e..d9b92bf0668 100644 --- a/nscd/nscd_proto.h +++ b/nscd/nscd_proto.h @@ -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 , 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)); -- 2.47.2