lkml.org 
[lkml]   [2022]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] SUNRPC: Increase size of servername string
Date
On Thu, 24 Mar 2022, Haowen Bai wrote:
> 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>
> ---
> net/sunrpc/clnt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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[108];

It would be much nicer to use UNIX_PATH_MAX

NeilBrown


> struct rpc_clnt *clnt;
> int i;
>
> --
> 2.7.4
>
>

\
 
 \ /
  Last update: 2022-03-25 03:11    [W:0.070 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site