summaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv/revnetgroup/parse_netgroup.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-22 09:09:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-22 09:09:33 +0000
commit79c512971e63b9113a378f3d82f239e6518a390b (patch)
tree60a70a4351b5c752d36c6be85e06dfe53d24dfde /usr.sbin/ypserv/revnetgroup/parse_netgroup.c
parent81ed744a68ae422432934fb4032bbb35f4b0862d (diff)
more strcpy/sprintf death; mpech ok
Diffstat (limited to 'usr.sbin/ypserv/revnetgroup/parse_netgroup.c')
-rw-r--r--usr.sbin/ypserv/revnetgroup/parse_netgroup.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ypserv/revnetgroup/parse_netgroup.c b/usr.sbin/ypserv/revnetgroup/parse_netgroup.c
index 2a4f62eac61..b13fe325226 100644
--- a/usr.sbin/ypserv/revnetgroup/parse_netgroup.c
+++ b/usr.sbin/ypserv/revnetgroup/parse_netgroup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse_netgroup.c,v 1.3 2002/03/14 16:44:25 mpech Exp $ */
+/* $OpenBSD: parse_netgroup.c,v 1.4 2002/05/22 09:09:32 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -51,7 +51,7 @@
#include "hash.h"
#ifndef lint
-static const char rcsid[] = "$OpenBSD: parse_netgroup.c,v 1.3 2002/03/14 16:44:25 mpech Exp $";
+static const char rcsid[] = "$OpenBSD: parse_netgroup.c,v 1.4 2002/05/22 09:09:32 deraadt Exp $";
#endif
/*
@@ -113,9 +113,10 @@ __setnetgrent(group)
if (parse_netgrp(group))
__endnetgrent();
else {
- grouphead.grname = (char *)
- malloc(strlen(group) + 1);
- strcpy(grouphead.grname, group);
+ int len = strlen(group) + 1;
+
+ grouphead.grname = malloc(len);
+ strlcpy(grouphead.grname, group, len);
}
}
nextgrp = grouphead.gr;