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 12:05:43 UTC 2020


laforge has submitted this change. ( 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(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



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-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201221/c0042a48/attachment.htm>


More information about the gerrit-log mailing list