summaryrefslogtreecommitdiff
path: root/nis/nss_nisplus/nisplus-netgrp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-12-03 22:15:54 +0000
committerUlrich Drepper <drepper@redhat.com>2005-12-03 22:15:54 +0000
commit8e64faef03af02a8d4635d199a5b8e55ec68111e (patch)
treeb9fc41a4185921aaf04c69fbf720a0fb410a4458 /nis/nss_nisplus/nisplus-netgrp.c
parent636e689e6fb0da525b80620cdb64cdaf75aa3c6a (diff)
downloadglibc-8e64faef03af02a8d4635d199a5b8e55ec68111e.tar.gz
* nis/nis_error.c (nis_sperror_r): Let snprintf determine whether
there is an overflow. * nis/nss_nisplus/nisplus-netgrp.c (_nss_nisplus_setnetgrent): Rewrite to use snprintf. * nis/nss_nisplus/nisplus-publickey.c (_nss_nisplus_netname2user): Likewise.
Diffstat (limited to 'nis/nss_nisplus/nisplus-netgrp.c')
-rw-r--r--nis/nss_nisplus/nisplus-netgrp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/nis/nss_nisplus/nisplus-netgrp.c b/nis/nss_nisplus/nisplus-netgrp.c
index 344d65f4c4..31a8cdf097 100644
--- a/nis/nss_nisplus/nisplus-netgrp.c
+++ b/nis/nss_nisplus/nisplus-netgrp.c
@@ -150,15 +150,14 @@ internal_endnetgrent (struct __netgrent *netgrp)
enum nss_status
_nss_nisplus_setnetgrent (const char *group, struct __netgrent *netgrp)
{
- enum nss_status status;
- char buf[strlen (group) + 30];
+ char buf[strlen (group) + 25];
if (group == NULL || group[0] == '\0')
return NSS_STATUS_UNAVAIL;
- status = NSS_STATUS_SUCCESS;
+ enum nss_status status = NSS_STATUS_SUCCESS;
- sprintf (buf, "[name=%s],netgroup.org_dir", group);
+ snprintf (buf, sizeof (buf), "[name=%s],netgroup.org_dir", group);
netgrp->data = (char *) nis_list (buf, EXPAND_NAME, NULL, NULL);