Change in osmo-bsc[master]: ipaccess_sign_link_reject: fix: use osmo_strlcpy() to safely copy IP

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/.

osmith gerrit-no-reply at lists.osmocom.org
Wed Oct 31 09:43:45 UTC 2018


osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/11538 )

Change subject: ipaccess_sign_link_reject: fix: use osmo_strlcpy() to safely copy IP
......................................................................

ipaccess_sign_link_reject: fix: use osmo_strlcpy() to safely copy IP

Fixes: coverity scan CID#189459
Change-Id: Ib9c5e374b9c5c8f79eecf95c439a25b0f438e4e5
---
M src/osmo-bsc/bts_ipaccess_nanobts.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c
index 40cabb8..1fffd89 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts.c
@@ -32,6 +32,7 @@
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/socket.h>
 #include <osmocom/core/talloc.h>
+#include <osmocom/core/utils.h>
 #include <osmocom/bsc/gsm_data.h>
 #include <osmocom/bsc/abis_nm.h>
 #include <osmocom/bsc/abis_rsl.h>
@@ -494,7 +495,7 @@
 			return;
 		entry->site_id = site_id;
 		entry->bts_id = bts_id;
-		strncpy(entry->ip, ip, sizeof(entry->ip));
+		osmo_strlcpy(entry->ip, ip, sizeof(entry->ip));
 	}
 
 	/* Add to beginning with current timestamp */

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9c5e374b9c5c8f79eecf95c439a25b0f438e4e5
Gerrit-Change-Number: 11538
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181031/27f1bd2f/attachment.htm>


More information about the gerrit-log mailing list