mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-04 22:13:18 +00:00
libabis: fix segfault on malformed ipaccess RSL link
This patch fixes a segfault that occured when a ipaccess RSL link gets closed unexpectedly. The segfault can be provoked by connecting to the RSL port with ncat and hitting ^C.
This commit is contained in:
committed by
Harald Welte
parent
9e26773167
commit
792edebb4f
@@ -429,12 +429,15 @@ static int ipaccess_drop(struct e1inp_ts *ts, struct osmo_fd *bfd)
|
|||||||
struct e1inp_sign_link *link;
|
struct e1inp_sign_link *link;
|
||||||
int bts_nr;
|
int bts_nr;
|
||||||
|
|
||||||
if (!ts) {
|
if (!ts || !bfd->data) {
|
||||||
/*
|
/*
|
||||||
* If we don't have a TS this means that this is a RSL
|
* If we don't have a TS this means that this is a RSL
|
||||||
* connection but we are not past the authentication
|
* connection but we are not past the authentication
|
||||||
* handling yet. So we can safely delete this bfd and
|
* handling yet. So we can safely delete this bfd and
|
||||||
* wait for a reconnect.
|
* wait for a reconnect.
|
||||||
|
* If we don't have bfd->data this means that a RSL
|
||||||
|
* connection was accept()ed, but nothing was recv()ed
|
||||||
|
* and the connection gets close()ed.
|
||||||
*/
|
*/
|
||||||
osmo_fd_unregister(bfd);
|
osmo_fd_unregister(bfd);
|
||||||
close(bfd->fd);
|
close(bfd->fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user