sgs_iface: fix nullpointer dereference
The function sgs_tx() is using the sgs connection pointer as context, even though it has done a check for a nullpointer in the line before. This is very prone to lead into a segfault when the SGs connection dies. Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Related: OS#3859
This commit is contained in:
parent
5dede769e7
commit
7231edb732
|
@ -301,8 +301,8 @@ static void sgs_tx(struct sgs_connection *sgc, struct msgb *msg)
|
|||
|
||||
msgb_sctp_ppid(msg) = 0;
|
||||
if (!sgc) {
|
||||
LOGSGC(sgc, LOGL_NOTICE, "Cannot transmit %s: connection dead. Discarding\n",
|
||||
sgsap_msg_type_name(msg->data[0]));
|
||||
LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection dead. Discarding\n",
|
||||
sgsap_msg_type_name(msg->data[0]));
|
||||
msgb_free(msg);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue