libmsc/db: avoid subscr->name without terminating NULL char
Change-Id: Ic8944ac4c5e940c9d835c52f1701461f274238db Fixes: Coverity CID 57621
This commit is contained in:
parent
b0993e61d0
commit
96df077083
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue