From e6579c27ccf6cbaf2935fad8d605ef1b85e9df5c Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Sat, 9 Mar 2024 18:09:26 -0800 Subject: [PATCH] FIXME removed from list We have similar code in the first version of nc-server: 2017-02-27 tests-bin: add nc-server utility 1e337bef2473c2154b21ba8230062b9eddc4f00c --- spiped/dispatch.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spiped/dispatch.c b/spiped/dispatch.c index 6641ac60..bf5c487e 100644 --- a/spiped/dispatch.c +++ b/spiped/dispatch.c @@ -296,9 +296,16 @@ dispatch_shutdown(void * dispatch_cookie) * callback_conndied(), which removes the relevant conn_list_node from * the list of conn_cookies. */ - while ((C = LIST_FIRST(&A->conn_cookies)) != NULL) + while ((C = LIST_FIRST(&A->conn_cookies)) != NULL) { proto_conn_drop(C->conn_cookie, PROTO_CONN_CANCELLED); + /* + * Convince static analyzers that C->conn_cookie is no longer + * in the list. + */ + assert(C != LIST_FIRST(&A->conn_cookies)); + } + if (A->accept_cookie != NULL) network_accept_cancel(A->accept_cookie); if (A->dnstimer_cookie != NULL)