[PATCH rtems-libbsd 6-freebsd-12 1/2] rtemsbsd/syscall: Set unitialised variable in open

chrisj at rtems.org chrisj at rtems.org
Sun Aug 6 05:54:16 UTC 2023


From: Chris Johns <chrisj at rtems.org>

The open path length was not set when at the root node and this
sometimes failed the current directory checks.
---
 rtemsbsd/rtems/rtems-bsd-syscall-api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rtemsbsd/rtems/rtems-bsd-syscall-api.c b/rtemsbsd/rtems/rtems-bsd-syscall-api.c
index 81361e94..800aa323 100644
--- a/rtemsbsd/rtems/rtems-bsd-syscall-api.c
+++ b/rtemsbsd/rtems/rtems-bsd-syscall-api.c
@@ -918,6 +918,7 @@ rtems_bsd_sysgen_open_node(
 	if (rtems_bsd_libio_loc_to_vnode(&iop->pathinfo) ==
 	    rtems_bsd_libio_loc_to_vnode(rootloc)) {
 		opath = ".";
+		opathlen = 1;
 	} else {
 		opath = path + strlen(path);
 		opathlen = 0;
-- 
2.37.1



More information about the devel mailing list