summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2005-08-06 17:03:56 +0000
committerderaadt <deraadt@openbsd.org>2005-08-06 17:03:56 +0000
commitb306eeb1d88b7e08d05019c175a952cb443b7d4b (patch)
tree41527e3c3bf9272edfe21a9f546d4ddb44e61ef4 /lib/libc
parentzap rcsid. It's not ramdisk, but they still take space. (diff)
downloadwireguard-openbsd-b306eeb1d88b7e08d05019c175a952cb443b7d4b.tar.xz
wireguard-openbsd-b306eeb1d88b7e08d05019c175a952cb443b7d4b.zip
fix use after free, netbsd pr 30832, from phirerunner@comcast.net
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/getnetgrent.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c
index 51a04a5c9c9..dc074fae3f9 100644
--- a/lib/libc/gen/getnetgrent.c
+++ b/lib/libc/gen/getnetgrent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetgrent.c,v 1.15 2004/05/18 02:05:52 jfb Exp $ */
+/* $OpenBSD: getnetgrent.c,v 1.16 2005/08/06 17:03:56 deraadt Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getnetgrent.c,v 1.15 2004/05/18 02:05:52 jfb Exp $";
+static char *rcsid = "$OpenBSD: getnetgrent.c,v 1.16 2005/08/06 17:03:56 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -367,8 +367,8 @@ addgroup(char *ypdom, struct stringlist *sl, char *grp)
#endif
/* check for cycles */
if (_ng_sl_find(sl, grp) != NULL) {
- free(grp);
_warnx("netgroup: Cycle in group `%s'", grp);
+ free(grp);
return;
}
_ng_sl_add(sl, grp);
@@ -445,8 +445,8 @@ in_find(char *ypdom, struct stringlist *sl, char *grp, const char *host,
#endif
/* check for cycles */
if (_ng_sl_find(sl, grp) != NULL) {
- free(grp);
_warnx("netgroup: Cycle in group `%s'", grp);
+ free(grp);
return 0;
}
_ng_sl_add(sl, grp);