mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
sgsn: seleted_apn_str might be NULL do not strcpy
The subscriber might simply not be allowed to use the APN that was specified. So selected_apn_str might very well be NULL. Fixes: Coverity CID#1302853
This commit is contained in:
@@ -709,7 +709,10 @@ struct sgsn_ggsn_ctx *sgsn_mm_ctx_find_ggsn_ctx(struct sgsn_mm_ctx *mmctx,
|
||||
}
|
||||
|
||||
/* copy the selected apn_str */
|
||||
strcpy(out_apn_str, selected_apn_str);
|
||||
if (selected_apn_str)
|
||||
strcpy(out_apn_str, selected_apn_str);
|
||||
else
|
||||
out_apn_str[0] = '\0';
|
||||
|
||||
if (apn_ctx == NULL && selected_apn_str)
|
||||
apn_ctx = sgsn_apn_ctx_match(selected_apn_str, mmctx->imsi);
|
||||
|
Reference in New Issue
Block a user