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.
This commit is contained in:
Pablo Neira Ayuso 2011-03-27 21:31:48 +02:00 committed by Harald Welte
parent 928cb33eb4
commit 3c409c249d
1 changed files with 5 additions and 0 deletions

View File

@ -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 */