aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/db.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index 68eba3e17..5cccb3280 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -831,8 +831,10 @@ static void db_set_from_query(struct gsm_subscriber *subscr, dbi_conn result)
subscr->tmsi = tmsi_from_string(string);
string = dbi_result_get_string(result, "name");
- if (string)
+ if (string) {
strncpy(subscr->name, string, GSM_NAME_LENGTH);
+ subscr->name[sizeof(subscr->name)-1] = '\0';
+ }
string = dbi_result_get_string(result, "extension");
if (string)