diff mbox series

[V2] SUNRPC: Increase size of servername string

Message ID 1648174702-461-1-git-send-email-baihaowen@meizu.com (mailing list archive)
State New, archived
Headers show
Series [V2] SUNRPC: Increase size of servername string | expand

Commit Message

baihaowen March 25, 2022, 2:18 a.m. UTC
This patch will fix the warning from smatch:

net/sunrpc/clnt.c:562 rpc_create() error: snprintf() chops off
the last chars of 'sun->sun_path': 108 vs 48

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
V1->V2: it would be much nicer to use UNIX_PATH_MAX
 net/sunrpc/clnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index c83fe61..6e0209e 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -526,7 +526,7 @@  struct rpc_clnt *rpc_create(struct rpc_create_args *args)
 		.servername = args->servername,
 		.bc_xprt = args->bc_xprt,
 	};
-	char servername[48];
+	char servername[UNIX_PATH_MAX];
 	struct rpc_clnt *clnt;
 	int i;