qemu-devel
[Top][All Lists]
Advanced

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

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


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] rdmacm-mux: fix strcpy string warning
Date: Fri, 12 Jul 2019 19:33:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 12/07/19 18:51, 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;
>  
>          case 'p':
> 

Queued, thanks.

Paolo



reply via email to

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