libmsc: fix potential NULL-pointer dereferences detected by GCC's LTO

Change-Id: Ib7ba8909dce64d1b8ff3a53495fe3eefc446ed8e
changes/57/16357/2
Vadim Yanitskiy 3 years ago committed by laforge
parent c6b088bf38
commit db4839c267
  1. 5
      src/libmsc/msc_ho.c
  2. 5
      src/libmsc/msc_vty.c

@ -67,9 +67,12 @@ static __attribute__((constructor)) void msc_ho_fsm_init()
void msc_ho_down_required_reject(struct msc_a *msc_a, enum gsm0808_cause cause)
{
struct msc_i *msc_i = msc_a_msc_i(msc_a);
struct msc_i *msc_i;
uint32_t event;
msc_i = msc_a_msc_i(msc_a);
OSMO_ASSERT(msc_i);
struct ran_msg ran_enc_msg = {
.msg_type = RAN_MSG_HANDOVER_REQUIRED_REJECT,
.handover_required_reject = {

@ -1148,6 +1148,11 @@ static int _send_sms_str(struct vlr_subscr *receiver,
struct gsm_sms *sms;
sms = sms_from_text(receiver, sender_msisdn, 0, str);
if (!sms) {
LOGP(DLSMS, LOGL_ERROR, "Failed to allocate SMS\n");
return CMD_WARNING;
}
sms->protocol_id = tp_pid;
/* store in database for the queue */

Loading…
Cancel
Save