qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] rdmacm-mux: fix strcpy string warning


From: Yuval Shaia
Subject: Re: [Qemu-devel] [PATCH 1/2] rdmacm-mux: fix strcpy string warning
Date: Fri, 2 Aug 2019 05:57:41 +0300
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Jul 16, 2019 at 02:07:18PM +0400, Marc-André Lureau wrote:
> ../contrib/rdmacm-mux/main.c: In function ‘parse_args’:
> ../contrib/rdmacm-mux/main.c:118:13: error: ‘strncpy’ specified bound 3835 
> equals destination size [-Werror=stringop-truncation]
>   118 |             strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX);
> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  contrib/rdmacm-mux/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c
> index 30c7052651..de53048f06 100644
> --- a/contrib/rdmacm-mux/main.c
> +++ b/contrib/rdmacm-mux/main.c
> @@ -115,7 +115,7 @@ static void parse_args(int argc, char *argv[])
>  
>          case 's':
>              /* This is temporary, final name will build below */
> -            strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX);
> +            strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX - 1);
>              break;

Reviewed-by: Yuval Shaia <address@hidden>

>  
>          case 'p':
> -- 
> 2.22.0.428.g6d5b264208
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]