Skip to content

Commit

Permalink
- Fix crash when TLS connection is closed prematurely, when
Browse files Browse the repository at this point in the history
  reuse tree comparison is not properly identical to insertion.
  • Loading branch information
wcawijngaards committed Nov 24, 2020
1 parent 6a324a3 commit 978d384
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions doc/Changelog
Expand Up @@ -6,6 +6,8 @@
- iana portlist updated.
- Fix one port unit test for udp-connect.
- tag for the 1.13.0rc1 release.
- Fix crash when TLS connection is closed prematurely, when
reuse tree comparison is not properly identical to insertion.

23 November 2020: George
- Merge PR #313 from Ralph Dolmans: Replace edns-client-tag with
Expand Down
14 changes: 8 additions & 6 deletions services/outside_network.c
Expand Up @@ -886,6 +886,14 @@ decommission_pending_tcp(struct outside_network* outnet,
struct pending_tcp* pend)
{
verbose(VERB_CLIENT, "decommission_pending_tcp");
pend->next_free = outnet->tcp_free;
outnet->tcp_free = pend;
if(pend->reuse.node.key) {
/* needs unlink from the reuse tree to get deleted */
reuse_tcp_remove_tree_list(outnet, &pend->reuse);
}
/* free SSL structure after remove from outnet tcp reuse tree,
* because the c->ssl null or not is used for sorting in the tree */
if(pend->c->ssl) {
#ifdef HAVE_SSL
SSL_shutdown(pend->c->ssl);
Expand All @@ -894,12 +902,6 @@ decommission_pending_tcp(struct outside_network* outnet,
#endif
}
comm_point_close(pend->c);
pend->next_free = outnet->tcp_free;
outnet->tcp_free = pend;
if(pend->reuse.node.key) {
/* needs unlink from the reuse tree to get deleted */
reuse_tcp_remove_tree_list(outnet, &pend->reuse);
}
/* unlink the query and writewait list, it is part of the tree
* nodes and is deleted */
pend->query = NULL;
Expand Down

0 comments on commit 978d384

Please sign in to comment.