]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: sunrpc: Fix an off by one in rpc_sockaddr2uaddr()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 24 Oct 2023 21:58:20 +0000 (23:58 +0200)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:20:01 +0000 (18:20 -0400)
commit5e5038413d5762fc1b950ca1191d5593fe8196f2
tree96eea34a299d95a6b909f9a4924710041507b07c
parent9deb2010aa9fd92ecb775cf7543fe2facd5e1cd3
net: sunrpc: Fix an off by one in rpc_sockaddr2uaddr()

[ Upstream commit d6f4de70f73a106986ee315d7d512539f2f3303a ]

The intent is to check if the strings' are truncated or not. So, >= should
be used instead of >, because strlcat() and snprintf() return the length of
the output, excluding the trailing NULL.

Fixes: a02d69261134 ("SUNRPC: Provide functions for managing universal addresses")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/addr.c