libmsc: fix NULL pointer dereference in trans_lcls_compose()

Change-Id: I96342de4cb3e0bc3d3cac7538d4517aa211e8a38
Fixes: CID#240768
This commit is contained in:
Vadim Yanitskiy 2021-10-26 10:25:36 +03:00
parent a1a70be593
commit 583883bf2e
1 changed files with 5 additions and 5 deletions

View File

@ -112,6 +112,11 @@ struct gsm_trans *trans_find_by_sm_rp_mr(const struct gsm_network *net,
struct osmo_lcls *trans_lcls_compose(const struct gsm_trans *trans, bool use_lac)
{
if (!trans) {
LOGP(DCC, LOGL_ERROR, "LCLS: unable to fill parameters for unallocated transaction\n");
return NULL;
}
if (!trans->net->a.sri->sccp)
return NULL;
@ -119,11 +124,6 @@ struct osmo_lcls *trans_lcls_compose(const struct gsm_trans *trans, bool use_lac
struct osmo_lcls *lcls;
uint8_t w = osmo_ss7_pc_width(&ss7->cfg.pc_fmt);
if (!trans) {
LOGP(DCC, LOGL_ERROR, "LCLS: unable to fill parameters for unallocated transaction\n");
return NULL;
}
if (!trans->net->lcls_permitted) {
LOGP(DCC, LOGL_NOTICE, "LCLS disabled globally\n");
return NULL;