Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jul 2020 07:11:09 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r363688 - head/sys/kern
Message-ID:  <202007300711.06U7B9tF074226@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Thu Jul 30 07:11:08 2020
New Revision: 363688
URL: https://svnweb.freebsd.org/changeset/base/363688

Log:
  vfs: make sure startdir_used is always assigned to before use
  
  CID:	1431070

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Thu Jul 30 04:05:59 2020	(r363687)
+++ head/sys/kern/vfs_lookup.c	Thu Jul 30 07:11:08 2020	(r363688)
@@ -289,11 +289,13 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp,
 	struct pwd *pwd;
 	cap_rights_t rights;
 	struct filecaps dirfd_caps;
-	int error, startdir_used;
+	int error;
+	bool startdir_used;
 
 	cnp = &ndp->ni_cnd;
 	td = cnp->cn_thread;
 
+	startdir_used = false;
 	*pwdp = NULL;
 
 #ifdef CAPABILITY_MODE
@@ -340,7 +342,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp,
 	} else {
 		if (ndp->ni_startdir != NULL) {
 			*dpp = ndp->ni_startdir;
-			startdir_used = 1;
+			startdir_used = true;
 		} else if (ndp->ni_dirfd == AT_FDCWD) {
 			*dpp = pwd->pwd_cdir;
 			vrefact(*dpp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007300711.06U7B9tF074226>