summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1995-03-23 22:23:15 +0000
committerBill Paul <wpaul@FreeBSD.org>1995-03-23 22:23:15 +0000
commite17334c3292be0b076aca35fed6e8544b620c1bf (patch)
tree39d7b9d41b9c4d5dcced28d88862222c09c8e8bd /lib/libc
parent62a771700f5b785340b54378157d74deeb175530 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/yp/yplib.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c
index 1187a664dc33..f9d881d96597 100644
--- a/lib/libc/yp/yplib.c
+++ b/lib/libc/yp/yplib.c
@@ -28,7 +28,7 @@
*/
#ifndef LINT
-static char *rcsid = "$Id: yplib.c,v 1.1 1994/08/07 23:04:55 wollman Exp $";
+static char *rcsid = "$Id: yplib.c,v 1.2 1995/03/21 00:48:55 wpaul Exp $";
#endif
#include <sys/param.h>
@@ -380,6 +380,11 @@ int *outvallen;
*outval = NULL;
*outvallen = 0;
+ /* Sanity check: no null keys allowed! */
+
+ if (inkey == NULL || *inkey == '\0')
+ return YPERR_KEY;
+
again:
if( _yp_dobind(indomain, &ysd) != 0)
return YPERR_DOMAIN;
@@ -510,6 +515,11 @@ int *outvallen;
*outkey = *outval = NULL;
*outkeylen = *outvallen = 0;
+ /* Sanity check: no null keys allowed! */
+
+ if (inkey == NULL || *inkey == '\0')
+ return YPERR_KEY;
+
again:
if( _yp_dobind(indomain, &ysd) != 0)
return YPERR_DOMAIN;