summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/subscriber.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-08-11 14:15:09 +0200
committerHarald Welte <laforge@gnumonks.org>2018-08-11 16:10:31 +0200
commitd4fb4fdea097f0fd1e9f2cd72d0d8a30c91f48bf (patch)
tree2a76d28f1dfc3ad338cec98d08c66fd1cf826b61 /src/host/layer23/src/mobile/subscriber.c
parent1d68468636e789555bee99e1d040b0648d1f02c3 (diff)
layer23: Replace all instances of strncpy() by osmo_strlcpy
This gives us working/safe zero termination without overflowing the destination string size. Change-Id: Ica6098ceba2bd01ce3b216085442cc5eed0ca507
Diffstat (limited to 'src/host/layer23/src/mobile/subscriber.c')
-rw-r--r--src/host/layer23/src/mobile/subscriber.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/layer23/src/mobile/subscriber.c b/src/host/layer23/src/mobile/subscriber.c
index 6a30148b..7a011411 100644
--- a/src/host/layer23/src/mobile/subscriber.c
+++ b/src/host/layer23/src/mobile/subscriber.c
@@ -256,7 +256,7 @@ static int subscr_sim_imsi(struct osmocom_ms *ms, uint8_t *data,
return -EINVAL;
}
- strncpy(subscr->imsi, imsi + 1, sizeof(subscr->imsi) - 1);
+ OSMO_STRLCPY_ARRAY(subscr->imsi, imsi + 1);
LOGP(DMM, LOGL_INFO, "received IMSI %s from SIM\n", subscr->imsi);