summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1999-09-16 09:53:41 +0000
committerlukem <lukem@NetBSD.org>1999-09-16 09:53:41 +0000
commitb035f7ab5eaf8d585d8ab10fa52cb99bbcf7f62e (patch)
tree94ed07538ac836af8eadd42d52127867b2225e2a /lib
parentbd926931f5bc05e2136a1d68545bbe7b1d5011ca (diff)
check a couple more args
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/yp/yp_first.c11
-rw-r--r--lib/libc/yp/yp_maplist.c6
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/libc/yp/yp_first.c b/lib/libc/yp/yp_first.c
index 406074e62c7..025886a69e4 100644
--- a/lib/libc/yp/yp_first.c
+++ b/lib/libc/yp/yp_first.c
@@ -1,4 +1,4 @@
-/* $NetBSD: yp_first.c,v 1.10 1999/01/31 20:46:12 christos Exp $ */
+/* $NetBSD: yp_first.c,v 1.11 1999/09/16 09:53:41 lukem Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@fsa.ca>
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: yp_first.c,v 1.10 1999/01/31 20:46:12 christos Exp $");
+__RCSID("$NetBSD: yp_first.c,v 1.11 1999/09/16 09:53:41 lukem Exp $");
#endif
#include "namespace.h"
@@ -66,7 +66,8 @@ yp_first(indomain, inmap, outkey, outkeylen, outval, outvallen)
struct dom_binding *ysd;
int r, nerrs = 0;
- if (outkey == NULL || outval == NULL)
+ if (outkey == NULL || outkeylen == NULL || \
+ outval == NULL || outvallen == NULL)
return YPERR_BADARGS;
*outkey = *outval = NULL;
*outkeylen = *outvallen = 0;
@@ -143,7 +144,9 @@ yp_next(indomain, inmap, inkey, inkeylen, outkey, outkeylen, outval, outvallen)
struct dom_binding *ysd;
int r, nerrs = 0;
- if (outkey == NULL || outval == NULL)
+ if (outkey == NULL || outkeylen == NULL || \
+ outval == NULL || outvallen == NULL || \
+ inkey == NULL)
return YPERR_BADARGS;
*outkey = *outval = NULL;
*outkeylen = *outvallen = 0;
diff --git a/lib/libc/yp/yp_maplist.c b/lib/libc/yp/yp_maplist.c
index 1d80cb32152..6c1a8a6d9c1 100644
--- a/lib/libc/yp/yp_maplist.c
+++ b/lib/libc/yp/yp_maplist.c
@@ -1,4 +1,4 @@
-/* $NetBSD: yp_maplist.c,v 1.7 1999/01/31 20:46:12 christos Exp $ */
+/* $NetBSD: yp_maplist.c,v 1.8 1999/09/16 09:54:07 lukem Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@fsa.ca>
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: yp_maplist.c,v 1.7 1999/01/31 20:46:12 christos Exp $");
+__RCSID("$NetBSD: yp_maplist.c,v 1.8 1999/09/16 09:54:07 lukem Exp $");
#endif
#include "namespace.h"
@@ -61,6 +61,8 @@ yp_maplist(indomain, outmaplist)
if (_yp_invalid_domain(indomain))
return YPERR_BADARGS;
+ if (outmaplist == NULL)
+ return YPERR_BADARGS;
again:
if (_yp_dobind(indomain, &ysd) != 0)
return YPERR_DOMAIN;