summaryrefslogtreecommitdiffstats
path: root/sys/rpc/authunix_prot.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/rpc/authunix_prot.c')
-rw-r--r--sys/rpc/authunix_prot.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c
index 3092b1f..141f594 100644
--- a/sys/rpc/authunix_prot.c
+++ b/sys/rpc/authunix_prot.c
@@ -68,7 +68,12 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred)
uint32_t junk;
if (xdrs->x_op == XDR_ENCODE) {
+ /*
+ * Restrict name length to 255 according to RFC 1057.
+ */
namelen = strlen(hostname);
+ if (namelen > 255)
+ namelen = 255;
} else {
namelen = 0;
}
OpenPOWER on IntegriCloud