fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-pcu/+/31955 )
Change subject: fix pcu_l1if_tx_pch_dt(): use osmo_strlcpy() instead of strcpy()
......................................................................
fix pcu_l1if_tx_pch_dt(): use osmo_strlcpy() instead of strcpy()
strcpy() is an unsafe function, it may overflow the destination buffer.
Change-Id: I04a86c1e00fc0a4066564693f6b563c88bf4e46f
---
M src/pcu_l1_if.cpp
1 file changed, 12 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/55/31955/1
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 14cc778..754177c 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -304,7 +304,7 @@
struct gsm_pcu_if_pch_dt pch_dt;
pch_dt.tlli = tlli;
- strcpy(pch_dt.imsi, imsi);
+ osmo_strlcpy(&pch_dt.imsi[0], imsi, sizeof(pch_dt.imsi));
pch_dt.data[0] = (plen << 2) | 0x01;
bitvec_pack(block, pch_dt.data + 1);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-pcu/+/31955
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I04a86c1e00fc0a4066564693f6b563c88bf4e46f
Gerrit-Change-Number: 31955
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange