From aeeda76c9252ab03c1b91c879e6d890801b0ba2e Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 8 Apr 2021 12:19:11 +0200 Subject: [PATCH] StreamManagement: Fix HashMap potentially being altered while being itterated --- xmpp-vala/src/module/xep/0198_stream_management.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmpp-vala/src/module/xep/0198_stream_management.vala b/xmpp-vala/src/module/xep/0198_stream_management.vala index b9185808..e053f3fb 100644 --- a/xmpp-vala/src/module/xep/0198_stream_management.vala +++ b/xmpp-vala/src/module/xep/0198_stream_management.vala @@ -179,11 +179,11 @@ public class Module : XmppStreamNegotiationModule, WriteNodeFunc { var remove_nrs = new ArrayList(); foreach (int nr in in_flight_stanzas.keys) { if (nr <= h) { - in_flight_stanzas[nr].promise.set_value(null); remove_nrs.add(nr); } } foreach (int nr in remove_nrs) { + in_flight_stanzas[nr].promise.set_value(null); in_flight_stanzas.unset(nr); } }