summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/socket.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/socket.c b/usr/src/lib/brand/lx/lx_brand/common/socket.c
index 9a2e7fd845..2b26421183 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/socket.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/socket.c
@@ -1028,12 +1028,6 @@ stol_sockaddr(struct sockaddr *addr, socklen_t *len,
case AF_UNIX:
if (inlen > sizeof (struct sockaddr_un))
return (EINVAL);
- /*
- * If inlen is larger than orig, copy out the maximum amount of
- * data possible and then update *len to indicate the actual
- * size of all the data that it wanted to copy out.
- */
- size = (orig > 0 && orig < size) ? orig : size;
break;
case (sa_family_t)AF_NOTSUPPORTED:
@@ -1046,6 +1040,13 @@ stol_sockaddr(struct sockaddr *addr, socklen_t *len,
break;
}
+ /*
+ * If inlen is larger than orig, copy out the maximum amount of
+ * data possible and then update *len to indicate the actual
+ * size of all the data that it wanted to copy out.
+ */
+ size = (orig > 0 && orig < size) ? orig : size;
+
if (uucopy(inaddr, addr, size) < 0)
return (errno);