Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
4041-Fix-dtls-crash.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4041-Fix-dtls-crash.patch of Package erlang
From 9124d5911d9f24beffbbbbe0dfdbf430f0ba19f4 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson <dgud@erlang.org> Date: Fri, 5 Apr 2024 11:26:38 +0200 Subject: [PATCH] Fix dtls crash If connection get reset twice (in short time), the code could crash. --- lib/ssl/src/dtls_packet_demux.erl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/ssl/src/dtls_packet_demux.erl b/lib/ssl/src/dtls_packet_demux.erl index 86282d9e54..220fa84798 100644 --- a/lib/ssl/src/dtls_packet_demux.erl +++ b/lib/ssl/src/dtls_packet_demux.erl @@ -158,10 +158,15 @@ handle_call({new_connection, Old, _Pid}, _, #state{accepters = Accepters, dtls_msq_queues = MsgQs0} = State) -> case queue:is_empty(Accepters) of false -> - OldQueue = kv_get(Old, MsgQs0), - MsgQs1 = kv_delete(Old, MsgQs0), - MsgQs = kv_insert({old,Old}, OldQueue, MsgQs1), - {reply, true, State#state{dtls_msq_queues = MsgQs}}; + case kv_lookup(Old, MsgQs0) of + {value, OldQueue} -> + MsgQs1 = kv_delete(Old, MsgQs0), + MsgQs = kv_insert({old,Old}, OldQueue, MsgQs1), + {reply, true, State#state{dtls_msq_queues = MsgQs}}; + none -> + %% Already set as old + {reply, true, State} + end; true -> {reply, false, State} end; -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor