From 901956a52a8b376daa61730f6560cdaddda4b6e2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 25 Sep 2003 19:44:55 +0000 Subject: Update. * nis/nis_table.c (nis_list): Always strdup string used with ibreq->ibr_name. Add several NULL pointer checks. * nis/nss_nisplus/nisplus-alias.c: Add check for NULL return value of nis_list. * nis/nss_nisplus/nisplus-ethers.c: Likewise. * nis/nss_nisplus/nisplus-grp.c: Likewise. * nis/nss_nisplus/nisplus-hosts.c: Likewise. * nis/nss_nisplus/nisplus-netgrp.c: Likewise. * nis/nss_nisplus/nisplus-network.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-publickey.c: Likewise. * nis/nss_nisplus/nisplus-pwd.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise. * nis/nss_nisplus/nisplus-service.c: Likewise. * nis/nss_nisplus/nisplus-spwd.c: Likewise. --- nis/nss_nisplus/nisplus-netgrp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'nis/nss_nisplus/nisplus-netgrp.c') diff --git a/nis/nss_nisplus/nisplus-netgrp.c b/nis/nss_nisplus/nisplus-netgrp.c index 831a13d..2d5ddf0 100644 --- a/nis/nss_nisplus/nisplus-netgrp.c +++ b/nis/nss_nisplus/nisplus-netgrp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1997. @@ -153,7 +153,12 @@ _nss_nisplus_setnetgrent (const char *group, struct __netgrent *dummy) data = nis_list (buf, EXPAND_NAME, NULL, NULL); - if (niserr2nss (data->status) != NSS_STATUS_SUCCESS) + if (data == NULL) + { + __set_errno (ENOMEM); + status = NSS_STATUS_TRYAGAIN; + } + else if (niserr2nss (data->status) != NSS_STATUS_SUCCESS) { status = niserr2nss (data->status); nis_freeresult (data); -- cgit v1.1