[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/4] slirp: don't crash when tcp_sockclosed() is call
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 1/4] slirp: don't crash when tcp_sockclosed() is called with a NULL tp |
Date: |
Thu, 7 Apr 2016 13:04:10 +0200 |
From: Steven Luo <address@hidden>
Signed-off-by: Steven Luo <address@hidden>
Reviewed-by: Edgar E. Iglesias <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
slirp/tcp_subr.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index dbfd2c6..32ff452 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -356,6 +356,10 @@ tcp_sockclosed(struct tcpcb *tp)
DEBUG_CALL("tcp_sockclosed");
DEBUG_ARG("tp = %p", tp);
+ if (!tp) {
+ return;
+ }
+
switch (tp->t_state) {
case TCPS_CLOSED:
@@ -374,8 +378,7 @@ tcp_sockclosed(struct tcpcb *tp)
tp->t_state = TCPS_LAST_ACK;
break;
}
- if (tp)
- tcp_output(tp);
+ tcp_output(tp);
}
/*
--
2.8.0.rc3
- [Qemu-devel] [PULL 0/4] slirp: deliver received TCP RSTs to the guest, Samuel Thibault, 2016/04/07
- [Qemu-devel] [PULL 4/4] slirp: handle deferred ECONNREFUSED on non-blocking TCP sockets, Samuel Thibault, 2016/04/07
- [Qemu-devel] [PULL 1/4] slirp: don't crash when tcp_sockclosed() is called with a NULL tp, Samuel Thibault, 2016/04/07
- [Qemu-devel] [PULL 2/4] slirp: avoid use-after-free in slirp_pollfds_poll() if soread() returns an error, Samuel Thibault, 2016/04/07
- [Qemu-devel] [PULL 3/4] slirp: Propagate host TCP RST to the guest., Samuel Thibault, 2016/04/07
- Re: [Qemu-devel] [PULL 0/4] slirp: deliver received TCP RSTs to the guest, Peter Maydell, 2016/04/07