From 07a3bf0e8ff26578c0b996a88c8ebb0cf7329b83 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sat, 19 May 2018 11:03:08 +0200 Subject: [PATCH] dvb: Fix string copy wiht strlen() argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a new warning introduced by gcc 8 We already check just before that we have enough space, just do a regular memcpy with the full string size. camswclient.c:87:3: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] --- sys/dvb/camswclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dvb/camswclient.c b/sys/dvb/camswclient.c index 202056908d..19774e5631 100644 --- a/sys/dvb/camswclient.c +++ b/sys/dvb/camswclient.c @@ -84,7 +84,7 @@ cam_sw_client_open (CamSwClient * client, const char *sock_path) } addr.sun_family = AF_UNIX; - strncpy (addr.sun_path, sock_path, strlen (sock_path)); + memcpy (addr.sun_path, sock_path, strlen (sock_path) + 1); GST_INFO ("connecting to softcam socket: %s", sock_path); if ((client->sock = socket (PF_UNIX, SOCK_STREAM, 0)) < 0) {