From 98a58f9e6702ccd3239374bb7c0ceaa5289fe1d9 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 20 Nov 2009 16:56:25 +0000 Subject: [PATCH] tcp_input: move tcp_debug_print_state to prevent accessing pcb when it might already be deallocated due to calling tcp_abort in tcp_process. --- src/core/tcp_in.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index ac91f1b3..aa3f9f61 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -342,6 +342,11 @@ tcp_input(struct pbuf *p, struct netif *inp) tcp_output(pcb); } } +#if TCP_INPUT_DEBUG +#if TCP_DEBUG + tcp_debug_print_state(pcb->state); +#endif /* TCP_DEBUG */ +#endif /* TCP_INPUT_DEBUG */ } @@ -351,12 +356,6 @@ tcp_input(struct pbuf *p, struct netif *inp) pbuf_free(inseg.p); inseg.p = NULL; } -#if TCP_INPUT_DEBUG -#if TCP_DEBUG - tcp_debug_print_state(pcb->state); -#endif /* TCP_DEBUG */ -#endif /* TCP_INPUT_DEBUG */ - } else { /* If no matching PCB was found, send a TCP RST (reset) to the