aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-01-23 17:09:10 +0100
committerHarald Welte <laforge@gnumonks.org>2014-01-23 17:09:10 +0100
commit2e93a8683ca5f644d365380ef55d657598af6c7f (patch)
tree67264c7a16f088cf6de99b5274e2c23e282bdeca
parentbc7d6fbdbb4413b3594e305cd4b0389ac78fb2cf (diff)
bts_model_rsl_chan_act(): Handle tp==NULL case gracefully
The PCU may call this function without a valid 'tp' (tlv parsed) pointer, we need to make sure we take this into consideration...
-rw-r--r--src/osmo-bts-sysmo/oml.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index dbd5fd01..11222b18 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -1555,7 +1555,9 @@ int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp)
//uint8_t type = *TLVP_VAL(tp, RSL_IE_ACT_TYPE);
struct gsm48_chan_desc *cd;
- if (TLVP_PRESENT(tp, GSM48_IE_CHANDESC_2) &&
+ /* osmo-pcu calls this without a valid 'tp' parameter, so we
+ * need to make sure we don't crash here */
+ if (tp && TLVP_PRESENT(tp, GSM48_IE_CHANDESC_2) &&
TLVP_LEN(tp, GSM48_IE_CHANDESC_2) >= sizeof(*cd)) {
cd = (struct gsm48_chan_desc *)
TLVP_VAL(tp, GSM48_IE_CHANDESC_2);