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: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH 1/2] rdmacm-mux: fix strcpy string warning
Date: Tue, 16 Jul 2019 14:08:19 +0400

On Tue, Jul 16, 2019 at 2:07 PM Marc-André Lureau
<address@hidden> 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>

oops resend by mistake, please ignore

> ---
>  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':
> --
> 2.22.0.428.g6d5b264208
>



reply via email to

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