[gprs] BSSGP: Fix null pointer dereference

Zecke has found this using "make CC="clang --analyze"
This commit is contained in:
Harald Welte 2010-07-23 21:59:29 +02:00
parent 6e95c5ffa1
commit d30e087521
1 changed files with 3 additions and 2 deletions

View File

@ -429,7 +429,7 @@ static int bssgp_rx_resume(struct msgb *msg, struct tlv_parsed *tp,
static int bssgp_rx_llc_disc(struct msgb *msg, struct tlv_parsed *tp,
struct bssgp_bvc_ctx *ctx)
{
uint32_t tlli;
uint32_t tlli = 0;
if (!TLVP_PRESENT(tp, BSSGP_IE_TLLI) ||
!TLVP_PRESENT(tp, BSSGP_IE_LLC_FRAMES_DISCARDED) ||
@ -439,7 +439,8 @@ static int bssgp_rx_llc_disc(struct msgb *msg, struct tlv_parsed *tp,
"missing mandatory IE\n", ctx->bvci);
}
tlli = ntohl(*(uint32_t *)TLVP_VAL(tp, BSSGP_IE_TLLI));
if (TLVP_PRESENT(tp, BSSGP_IE_TLLI))
tlli = ntohl(*(uint32_t *)TLVP_VAL(tp, BSSGP_IE_TLLI));
DEBUGP(DBSSGP, "BSSGP BVCI=%u TLLI=%08x LLC DISCARDED\n",
ctx->bvci, tlli);