bsc_/gprs_subscriber: fix: use osmo_strlcpy() to safely copy IMSI

Fixes: coverity scan CID 163918
Change-Id: I4b2760b006a0707928530b4390c6997b79b02981
This commit is contained in:
Neels Hofmeyr 2017-03-08 18:30:22 +01:00
parent 69cdbe6f39
commit 94a9362192
2 changed files with 2 additions and 2 deletions

View File

@ -157,7 +157,7 @@ struct gprs_subscr *gprs_subscr_get_or_create(const char *imsi)
gsub = gprs_subscr_alloc();
if (!gsub)
return NULL;
strncpy(gsub->imsi, imsi, sizeof(gsub->imsi));
osmo_strlcpy(gsub->imsi, imsi, sizeof(gsub->imsi));
}
if (!gsub->sgsn_data)

View File

@ -80,7 +80,7 @@ void bsc_subscr_set_imsi(struct bsc_subscr *bsub, const char *imsi)
{
if (!bsub)
return;
strncpy(bsub->imsi, imsi, sizeof(bsub->imsi));
osmo_strlcpy(bsub->imsi, imsi, sizeof(bsub->imsi));
}
struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list,