aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorVladislav Yasevich <vladislav.yasevich@hp.com>2005-11-11 19:05:55 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-11 19:05:55 -0500
commit23ec47a0889dabf4b9e7f8d52e848194734159ee (patch)
tree1b8afadde8b3a60405163b60436897e1746084a2 /net/sctp
parent8eb55910521f3449a8125a38dd32fb676703395d (diff)
[SCTP]: Fix potential NULL pointer dereference in sctp_v4_get_saddr
It is possible to get to sctp_v4_get_saddr() without a valid association. This happens when processing OOTB packets and the cached route entry is no longer valid. However, when responding to OOTB packets we already properly set the source address based on the information in the OOTB packet. So, if we we get to sctp_v4_get_saddr() without an association we can simply return. Signed-off-by: Vladislav Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/protocol.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 26de4d3e1bd9..dc9dff396fad 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -530,6 +530,9 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc,
530{ 530{
531 struct rtable *rt = (struct rtable *)dst; 531 struct rtable *rt = (struct rtable *)dst;
532 532
533 if (!asoc)
534 return;
535
533 if (rt) { 536 if (rt) {
534 saddr->v4.sin_family = AF_INET; 537 saddr->v4.sin_family = AF_INET;
535 saddr->v4.sin_port = asoc->base.bind_addr.port; 538 saddr->v4.sin_port = asoc->base.bind_addr.port;