Fix potentially uninitialized use of variable fsb on error.
authormillert <millert@openbsd.org>
Wed, 1 Mar 2023 23:27:46 +0000 (23:27 +0000)
committermillert <millert@openbsd.org>
Wed, 1 Mar 2023 23:27:46 +0000 (23:27 +0000)
OK mbuhl@

sbin/mountd/mountd.c

index 1f4e5d4..634b67f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: mountd.c,v 1.89 2020/08/06 17:57:32 naddy Exp $       */
+/*     $OpenBSD: mountd.c,v 1.90 2023/03/01 23:27:46 millert Exp $     */
 /*     $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */
 
 /*
@@ -793,7 +793,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp)
 
                /* Check in the exports list */
                sigprocmask(SIG_BLOCK, &sighup_mask, NULL);
-               ep = ex_search(&fsb.f_fsid);
+               ep = bad ? NULL : ex_search(&fsb.f_fsid);
                hostset = defset = 0;
                if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset) ||
                    ((dp = dirp_search(ep->ex_dirl, dirpath)) &&