summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/common/vty.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2023-07-19 16:14:25 +0200
committerjolly <andreas@eversberg.eu>2023-08-08 04:30:33 +0000
commit845ad38328db3134f271ae696d14f7ece88315d8 (patch)
treec3d3c4a2831760a42e35337a03a1139caf6a5f2c /src/host/layer23/src/common/vty.c
parent171ba463828af143911d38e8a4885759f9d2e389 (diff)
Fix VTY command to set IMEISV.
The pointer and size must given for the SV portion of the character array only. Fixes: CID#314049, CID#314048 Change-Id: Ieff4ca886dec71aae1b6ecf2b623d600426580da
Diffstat (limited to 'src/host/layer23/src/common/vty.c')
-rw-r--r--src/host/layer23/src/common/vty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/host/layer23/src/common/vty.c b/src/host/layer23/src/common/vty.c
index 526db6fc..dd80a14b 100644
--- a/src/host/layer23/src/common/vty.c
+++ b/src/host/layer23/src/common/vty.c
@@ -819,7 +819,8 @@ DEFUN(cfg_ms_imei, cfg_ms_imei_cmd, "imei IMEI [SV]",
OSMO_STRLCPY_ARRAY(set->imei, argv[0]);
OSMO_STRLCPY_ARRAY(set->imeisv, argv[0]);
- OSMO_STRLCPY_ARRAY(set->imeisv + 15, sv);
+ osmo_strlcpy(set->imeisv + GSM23003_IMEI_NUM_DIGITS, sv,
+ sizeof(set->imeisv) - GSM23003_IMEI_NUM_DIGITS);
return CMD_SUCCESS;
}