Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ypbind Initialize ypbind_resp before first possible...



details:   https://anonhg.NetBSD.org/src/rev/9a3c9109ce94
branches:  trunk
changeset: 321407:9a3c9109ce94
user:      ginsbach <ginsbach%NetBSD.org@localhost>
date:      Thu Mar 15 02:25:31 2018 +0000

description:
Initialize ypbind_resp before first possible error return condition.

diffstat:

 usr.sbin/ypbind/ypbind.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r 03b9f68727e2 -r 9a3c9109ce94 usr.sbin/ypbind/ypbind.c
--- a/usr.sbin/ypbind/ypbind.c  Thu Mar 15 01:20:43 2018 +0000
+++ b/usr.sbin/ypbind/ypbind.c  Thu Mar 15 02:25:31 2018 +0000
@@ -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@localhost>
@@ -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 @@
 
        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



Home | Main Index | Thread Index | Old Index