Module Name: src Committed By: ginsbach Date: Thu Mar 15 02:25:31 UTC 2018
Modified Files: src/usr.sbin/ypbind: ypbind.c Log Message: Initialize ypbind_resp before first possible error return condition. To generate a diff of this commit: cvs rdiff -u -r1.99 -r1.100 src/usr.sbin/ypbind/ypbind.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/ypbind/ypbind.c diff -u src/usr.sbin/ypbind/ypbind.c:1.99 src/usr.sbin/ypbind/ypbind.c:1.100 --- src/usr.sbin/ypbind/ypbind.c:1.99 Wed Aug 9 01:56:42 2017 +++ src/usr.sbin/ypbind/ypbind.c Thu Mar 15 02:25:31 2018 @@ -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 <dera...@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, voi 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