aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-03-27 21:31:48 +0200
committerHarald Welte <laforge@gnumonks.org>2011-03-27 22:21:08 +0200
commit3c409c249de1b372d8493cb6b408ec54ff4b0a41 (patch)
treec07378c232ccedc75049b527928935c8b8891519 /openbsc/src
parent928cb33eb464989260effceff15a436ded5dae41 (diff)
ipaccess-proxy: fix segfault in handle_dead_socket
This patch fixes a segfault if we or one BTS start a TCP connection and close it before any IPAC_MSGT_ID_RESP message is sent.
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/ipaccess/ipaccess-proxy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c
index 56fe160cb..d98eb54e7 100644
--- a/openbsc/src/ipaccess/ipaccess-proxy.c
+++ b/openbsc/src/ipaccess/ipaccess-proxy.c
@@ -806,6 +806,11 @@ static void handle_dead_socket(struct bsc_fd *bfd)
switch (bfd->priv_nr & 0xff) {
case OML_FROM_BTS: /* incoming OML data from BTS, forward to BSC OML */
+ /* The BTS started a connection with us but we got no
+ * IPAC_MSGT_ID_RESP message yet, in that scenario we did not
+ * allocate the ipa_bts_conn structure. */
+ if (ipbc == NULL)
+ break;
ipbc->oml_conn = NULL;
bsc_conn = ipbc->bsc_oml_conn;
/* close the connection to the BSC */