diff options
author | Steven Luo <steven+qemu@steven676.net> | 2016-04-06 22:04:21 -0700 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-04-07 10:27:22 +0200 |
commit | 804f441a9d6998a57040bf36685a17a6436b2ea8 (patch) | |
tree | ddf1ae866354901ece4372d209b2da8fdacb9c95 | |
parent | 8a21a4aabf12e599098e33a46204323098fd3f12 (diff) | |
download | slirp-804f441a9d6998a57040bf36685a17a6436b2ea8.zip slirp-804f441a9d6998a57040bf36685a17a6436b2ea8.tar.gz slirp-804f441a9d6998a57040bf36685a17a6436b2ea8.tar.bz2 |
slirp: don't crash when tcp_sockclosed() is called with a NULL tp
Signed-off-by: Steven Luo <steven+qemu@steven676.net>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-rw-r--r-- | tcp_subr.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -355,6 +355,10 @@ void tcp_sockclosed(struct tcpcb *tp) DEBUG_CALL("tcp_sockclosed"); DEBUG_ARG("tp = %p", tp); + if (!tp) { + return; + } + switch (tp->t_state) { case TCPS_CLOSED: case TCPS_LISTEN: @@ -372,8 +376,7 @@ void tcp_sockclosed(struct tcpcb *tp) tp->t_state = TCPS_LAST_ACK; break; } - if (tp) - tcp_output(tp); + tcp_output(tp); } /* |