summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-12-02 21:14:16 +0000
committerderaadt <deraadt@openbsd.org>1996-12-02 21:14:16 +0000
commit8ee318e82ebd420d09938a4d49badf1439bf057c (patch)
tree24306776951a7a7b29ee21562e0396700d21beed
parentincrease default data limit to size needed for make build (diff)
downloadwireguard-openbsd-8ee318e82ebd420d09938a4d49badf1439bf057c.tar.xz
wireguard-openbsd-8ee318e82ebd420d09938a4d49badf1439bf057c.zip
bail nice
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv_db.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/usr.sbin/ypserv/ypserv/ypserv_db.c b/usr.sbin/ypserv/ypserv/ypserv_db.c
index 5b86c22fbec..1d7ef585aca 100644
--- a/usr.sbin/ypserv/ypserv/ypserv_db.c
+++ b/usr.sbin/ypserv/ypserv/ypserv_db.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypserv_db.c,v 1.8 1996/11/11 17:22:15 niklas Exp $ */
+/* $OpenBSD: ypserv_db.c,v 1.9 1996/12/02 21:14:16 deraadt Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -34,7 +34,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypserv_db.c,v 1.8 1996/11/11 17:22:15 niklas Exp $";
+static char rcsid[] = "$OpenBSD: ypserv_db.c,v 1.9 1996/12/02 21:14:16 deraadt Exp $";
#endif
/*
@@ -117,28 +117,32 @@ yp_private(key,ypprivate)
{
int result;
- if (ypprivate) return (FALSE);
+ if (ypprivate)
+ return (FALSE);
+
+ if (key.dsize == 0 || key.dptr == NULL)
+ return (FALSE);
if (key.dsize == YP_LAST_LEN &&
- strncmp(key.dptr,YP_LAST_KEY,YP_LAST_LEN) == 0)
+ strncmp(key.dptr,YP_LAST_KEY,YP_LAST_LEN) == 0)
return(TRUE);
if (key.dsize == YP_INPUT_LEN &&
- strncmp(key.dptr,YP_INPUT_KEY,YP_INPUT_LEN) == 0)
+ strncmp(key.dptr,YP_INPUT_KEY,YP_INPUT_LEN) == 0)
return(TRUE);
if (key.dsize == YP_OUTPUT_LEN &&
- strncmp(key.dptr,YP_OUTPUT_KEY,YP_OUTPUT_LEN) == 0)
+ strncmp(key.dptr,YP_OUTPUT_KEY,YP_OUTPUT_LEN) == 0)
return(TRUE);
if (key.dsize == YP_MASTER_LEN &&
- strncmp(key.dptr,YP_MASTER_KEY,YP_MASTER_LEN) == 0)
+ strncmp(key.dptr,YP_MASTER_KEY,YP_MASTER_LEN) == 0)
return(TRUE);
if (key.dsize == YP_DOMAIN_LEN &&
- strncmp(key.dptr,YP_DOMAIN_KEY,YP_DOMAIN_LEN) == 0)
+ strncmp(key.dptr,YP_DOMAIN_KEY,YP_DOMAIN_LEN) == 0)
return(TRUE);
if (key.dsize == YP_INTERDOMAIN_LEN &&
- strncmp(key.dptr,YP_INTERDOMAIN_KEY,YP_INTERDOMAIN_LEN) == 0)
+ strncmp(key.dptr,YP_INTERDOMAIN_KEY,YP_INTERDOMAIN_LEN) == 0)
return(TRUE);
if (key.dsize == YP_SECURE_LEN &&
- strncmp(key.dptr,YP_SECURE_KEY,YP_SECURE_LEN) == 0)
+ strncmp(key.dptr,YP_SECURE_KEY,YP_SECURE_LEN) == 0)
return(TRUE);
return(FALSE);