diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 8429706ba6c6..7b373d3ab376 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -1,4 +1,4 @@ -/* $NetBSD: ypbind.c,v 1.99 2017/08/09 01:56:42 ginsbach Exp $ */ +/* $NetBSD: ypbind.c,v 1.100 2018/03/15 02:25:31 ginsbach Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt @@ -28,7 +28,7 @@ #include #ifndef LINT -__RCSID("$NetBSD: ypbind.c,v 1.99 2017/08/09 01:56:42 ginsbach Exp $"); +__RCSID("$NetBSD: ypbind.c,v 1.100 2018/03/15 02:25:31 ginsbach Exp $"); #endif #include @@ -710,15 +710,15 @@ ypbindproc_domain_2(SVCXPRT *transp, void *argp) DPRINTF("ypbindproc_domain_2 %s\n", arg); + (void)memset(&res, 0, sizeof res); + res.ypbind_status = YPBIND_FAIL_VAL; + /* Reject invalid domains. */ if (_yp_invalid_domain(arg)) { res.ypbind_respbody.ypbind_error = YPBIND_ERR_NOSERV; return &res; } - (void)memset(&res, 0, sizeof res); - res.ypbind_status = YPBIND_FAIL_VAL; - /* * Look for the domain. XXX: Behave erratically if we have * more than 100 domains. The intent here is to avoid allowing