[rtems-libbsd commit] Fix heap corruption in UNIX domain socket connect

Sebastian Huber sebh at rtems.org
Tue Feb 2 07:13:49 UTC 2016


Module:    rtems-libbsd
Branch:    4.11
Commit:    af60212c0b984939003b47356d71adcc1a6bcb00
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=af60212c0b984939003b47356d71adcc1a6bcb00

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Feb  2 08:04:33 2016 +0100

Fix heap corruption in UNIX domain socket connect

Close #2558.

---

 freebsd/sys/kern/uipc_usrreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/freebsd/sys/kern/uipc_usrreq.c b/freebsd/sys/kern/uipc_usrreq.c
index d2ee61c..da4b624 100644
--- a/freebsd/sys/kern/uipc_usrreq.c
+++ b/freebsd/sys/kern/uipc_usrreq.c
@@ -1440,10 +1440,10 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
 		goto bad;
 	VFS_UNLOCK_GIANT(vfslocked);
 #else /* __rtems__ */
-	soun->sun_path[len] = '\0';
 	eval_flags = RTEMS_FS_FOLLOW_LINK;
-	currentloc = rtems_filesystem_eval_path_start(&ctx,
-	    &soun->sun_path[0], eval_flags);
+	currentloc = rtems_filesystem_eval_path_start_with_root_and_current(
+	    &ctx, &soun->sun_path[0], (size_t)len, eval_flags,
+	    &rtems_filesystem_root, &rtems_filesystem_current);
 
 	if (currentloc->handlers == &socketops) {
 		vp = currentloc->node_access;



More information about the vc mailing list