summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
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 1187a66..f9d881d 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;
OpenPOWER on IntegriCloud