diff options
-rw-r--r-- | lib/libc/yp/ypmatch_cache.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/yp/ypmatch_cache.c b/lib/libc/yp/ypmatch_cache.c index 2800bf35542..43796faede1 100644 --- a/lib/libc/yp/ypmatch_cache.c +++ b/lib/libc/yp/ypmatch_cache.c @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: ypmatch_cache.c,v 1.8 2002/07/20 01:35:35 deraadt Exp $"; +static char *rcsid = "$OpenBSD: ypmatch_cache.c,v 1.9 2002/07/31 22:28:32 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -59,6 +59,9 @@ ypmatch_add(const char *map, const char *key, u_int keylen, char *val, struct ypmatch_ent *ep; time_t t; + if (keylen == 0 || vallen == 0) + return (0); + (void)time(&t); for (ep = ypmc; ep; ep = ep->next) |