diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2018-01-30 20:16:07 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2018-01-30 20:16:07 +0100 |
commit | b4d2499f43ab9f3f63f9560726bcb4f7284fc5fa (patch) | |
tree | 9c01564fc460150d29425e96b49558dbf279f801 /openbsc/src | |
parent | 960f58af407960ebf310281f72826c91e52e20c9 (diff) |
osmo-bsc_nat: Fix use-after-free issue in ctrl forwarding codedaniel/bsc-nat-rebase
Ticket: SYS#3208
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index 128ea6518..a1b6210e4 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -276,7 +276,8 @@ static int forward_to_bsc(struct ctrl_cmd *cmd) } pending->ccon = cmd->ccon; pending->ccon->closed_cb = ctrl_conn_closed_cb; - pending->cmd = cmd; + /* Copy command since it will be free()d after we exit here */ + pending->cmd = ctrl_cmd_cpy(pending, cmd); /* Setup the timeout */ osmo_timer_setup(&pending->timeout, pending_timeout_cb, |