From b035f7ab5eaf8d585d8ab10fa52cb99bbcf7f62e Mon Sep 17 00:00:00 2001 From: lukem Date: Thu, 16 Sep 1999 09:53:41 +0000 Subject: [PATCH] check a couple more args --- lib/libc/yp/yp_first.c | 11 +++++++---- lib/libc/yp/yp_maplist.c | 6 ++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/libc/yp/yp_first.c b/lib/libc/yp/yp_first.c index 406074e62c75..025886a69e48 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 @@ -33,7 +33,7 @@ #include #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 1d80cb321529..6c1a8a6d9c16 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 @@ -33,7 +33,7 @@ #include #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;