From b4f6f4be85d32b9c03361c38376e36f08100e3e8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 16 Aug 2005 16:05:37 +0000 Subject: [BZ #1188] 2005-08-10 Sergio Gelato [BZ #1188] * nis/nss_nis/nis-netgrp.c (_nss_nis_setnetgrent): Change assert check from (len > 0) to (len >= 0). 2005-08-16 Ulrich Drepper * nis/nis_xdr.c (_xdr_nis_result): Fix type of res variable. Reported by Thomas Schwinge. 2005-08-15 Jakub Jelinek * nis/nis_subr.c (nis_leaf_of_r): Handle buflen == 0 correctly. 2005-08-16 Ulrich Drepper * nss/getent.c (more_help): Use open_memstream instead of handling memory allocation ourselves. 2005-08-16 Jay Fenlason * nss/getent.c (parse_options): change the -s option to support {database}:{search} to override /etc/resolv.conf for only the specified database. --- nis/nis_subr.c | 2 +- nis/nis_xdr.c | 2 +- nis/nss_nis/nis-netgrp.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'nis') diff --git a/nis/nis_subr.c b/nis/nis_subr.c index 5838e30..7e29168 100644 --- a/nis/nis_subr.c +++ b/nis/nis_subr.c @@ -39,7 +39,7 @@ nis_leaf_of_r (const_nis_name name, char *buffer, size_t buflen) while (name[i] != '.' && name[i] != '\0') i++; - if (__builtin_expect (i > buflen - 1, 0)) + if (__builtin_expect (i >= buflen, 0)) { __set_errno (ERANGE); return NULL; diff --git a/nis/nis_xdr.c b/nis/nis_xdr.c index 820103b..1ef08c7 100644 --- a/nis/nis_xdr.c +++ b/nis/nis_xdr.c @@ -281,7 +281,7 @@ _xdr_nis_error (XDR *xdrs, nis_error *objp) bool_t _xdr_nis_result (XDR *xdrs, nis_result *objp) { - bool res = _xdr_nis_error (xdrs, &objp->status); + bool_t res = _xdr_nis_error (xdrs, &objp->status); if (__builtin_expect (res, TRUE)) { res = xdr_array (xdrs, (char **) &objp->objects.objects_val, diff --git a/nis/nss_nis/nis-netgrp.c b/nis/nss_nis/nis-netgrp.c index d339dd5..7bd6527 100644 --- a/nis/nss_nis/nis-netgrp.c +++ b/nis/nss_nis/nis-netgrp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996,1997,1999,2000,2002,2003,2004 +/* Copyright (C) 1996,1997,1999,2000,2002,2003,2004,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1996. @@ -75,7 +75,7 @@ _nss_nis_setnetgrent (const char *group, struct __netgrent *netgrp) which is one byte larger than the value in LEN specifies and the last byte is filled with NUL. So we can simply use that buffer. */ - assert (len > 0); + assert (len >= 0); assert (malloc_usable_size (netgrp->data) >= len + 1); assert (netgrp->data[len] == '\0'); -- cgit v1.1