Change in libosmocore[master]: gprs_ns2_fr: Avoid stringop-truncation warning

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Dec 21 11:41:35 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/21816 )


Change subject: gprs_ns2_fr: Avoid stringop-truncation warning
......................................................................

gprs_ns2_fr: Avoid stringop-truncation warning

gprs_ns2_fr.c:448:2: error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
  448 |  strncpy(req.ifr_name, netif, IFNAMSIZ);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: Ied9fd1bea091075fad266258da39e674d10d4dcb
---
M src/gb/gprs_ns2_fr.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/21816/1

diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 6019302..1485961 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -445,7 +445,7 @@
 		return sock;
 
 	memset(&req, 0, sizeof req);
-	strncpy(req.ifr_name, netif, IFNAMSIZ);
+	OSMO_STRLCPY_ARRAY(req.ifr_name, netif);
 
 	if (up)
 		req.ifr_flags |= IFF_UP;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21816
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ied9fd1bea091075fad266258da39e674d10d4dcb
Gerrit-Change-Number: 21816
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201221/b871e298/attachment.htm>


More information about the gerrit-log mailing list