Xin Long 912964eacb sctp: check af before verify address in sctp_addr_id2transport
Commit 6f29a1306131 ("sctp: sctp_addr_id2transport should verify the
addr before looking up assoc") invoked sctp_verify_addr to verify the
addr.

But it didn't check af variable beforehand, once users pass an address
with family = 0 through sockopt, sctp_get_af_specific will return NULL
and NULL pointer dereference will be caused by af->sockaddr_len.

This patch is to fix it by returning NULL if af variable is NULL.

Fixes: 6f29a1306131 ("sctp: sctp_addr_id2transport should verify the addr before looking up assoc")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-07 14:07:23 -05:00
..
2016-09-22 03:13:26 -04:00
2016-04-15 17:29:36 -04:00
2016-06-03 19:37:21 -04:00
2016-11-02 15:03:13 -04:00
2013-12-06 12:37:56 -05:00
2016-12-25 17:21:22 +01:00
2013-12-06 12:37:56 -05:00
2016-09-19 01:34:01 -04:00