aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/libcommon/gsup_test_client.c7
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/openbsc/src/libcommon/gsup_test_client.c b/openbsc/src/libcommon/gsup_test_client.c
index 1889c6fde..861212a64 100644
--- a/openbsc/src/libcommon/gsup_test_client.c
+++ b/openbsc/src/libcommon/gsup_test_client.c
@@ -7,6 +7,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/select.h>
#include <osmocom/core/application.h>
+#include <osmocom/core/utils.h>
#include <osmocom/gsm/gsup.h>
#include <openbsc/gsup_client.h>
@@ -108,7 +109,7 @@ int req_auth_info(const char *imsi)
struct osmo_gsup_message gsup = {0};
struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__);
- strncpy(gsup.imsi, io->imsi, sizeof(gsup.imsi));
+ osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi));
gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST;
osmo_gsup_encode(msg, &gsup);
@@ -123,7 +124,7 @@ int req_loc_upd(const char *imsi)
struct osmo_gsup_message gsup = {0};
struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__);
- strncpy(gsup.imsi, io->imsi, sizeof(gsup.imsi));
+ osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi));
gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST;
osmo_gsup_encode(msg, &gsup);
@@ -136,7 +137,7 @@ int resp_isd(struct imsi_op *io)
struct osmo_gsup_message gsup = {0};
struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__);
- strncpy(gsup.imsi, io->imsi, sizeof(gsup.imsi));
+ osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi));
gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT;
osmo_gsup_encode(msg, &gsup);
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index edece51c2..4f412b106 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -601,7 +601,7 @@ DEFUN(ena_subscr_extension,
return CMD_WARNING;
}
- strncpy(subscr->extension, ext, sizeof(subscr->extension));
+ osmo_strlcpy(subscr->extension, ext, sizeof(subscr->extension));
db_sync_subscriber(subscr);
subscr_put(subscr);