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.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/21779 )
Change subject: gprs_ns2_fr.c: compiler error: replace strncpy() with OSMO_STRLCPY_ARRAY()
......................................................................
gprs_ns2_fr.c: compiler error: replace strncpy() with OSMO_STRLCPY_ARRAY()
My gcc (Debian 8.3.0-6) 8.3.0 refuses to build this strncpy() use: it
issues the buffer length as n and thus potentially fails to account for
the terminating nul. The line after that fixes the problem, so it's not
an actual bug. Anyway, we have a policy to never use strncpy(), and have
osmo_strlcpy() and OSMO_STRLCPY_ARRAY() for this.
This strncpy() was introduced last month during first addition of
gprs_ns2_fr.c:
commit 841817ec52186029ca01f0c082ed84f2dc5ffcc5
ns2: add support for frame relay
Change-Id Id3b49f93d33c271f77cd9c9db03cde6b727a4d30
Change-Id: I494a6fb7ccd7938a39e8956f73ec4282da38d7fb
---
M src/gb/gprs_ns2_fr.c
1 file changed, 1 insertion(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index fc6f166..1ff80ed 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -296,8 +296,7 @@
memset(&ifr, 0, sizeof(ifr));
- strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
- ifr.ifr_name[sizeof(ifr.ifr_name)-1] = 0;
+ OSMO_STRLCPY_ARRAY(ifr.ifr_name, ifname);
rc = ioctl(sk, SIOCGIFINDEX, &ifr);
close(sk);
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21779
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I494a6fb7ccd7938a39e8956f73ec4282da38d7fb
Gerrit-Change-Number: 21779
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201218/7a2004d2/attachment.htm>