From 4573ca88345c553653eeea627cf4b51fa26ab9df Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 2 Dec 2015 14:15:36 +0100 Subject: [PATCH] gtphub: fix: add a missing NULL check Sponsored-by: On-Waves ehi --- openbsc/src/gprs/gtphub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 6dc1ea0fb..78e8c90c6 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -1277,6 +1277,8 @@ static int gtphub_check_reused_teis(struct gtphub *hub, te = &tun->endpoint[side_idx][plane_idx]; te2 = &new_tun->endpoint[side_idx][plane_idx]; if ((te->tei_orig != te2->tei_orig) + || (!te->peer) + || (!te2->peer) || !gsn_addr_same(&te->peer->peer_addr->addr, &te2->peer->peer_addr->addr)) continue;