Initialize ypbind_resp before first possible error return condition.

This commit is contained in:
ginsbach 2018-03-15 02:25:31 +00:00
parent 613a287d51
commit 617ab226ea
1 changed files with 5 additions and 5 deletions

View File

@ -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 <deraadt@fsa.ca>
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#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 <sys/types.h>
@ -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