File freerdp-CVE-2026-22856.patch of Package freerdp2

From 675c20f08f32ca5ec06297108bdf30147d6e2cd9 Mon Sep 17 00:00:00 2001
From: akallabeth <akallabeth@posteo.net>
Date: Tue, 13 Jan 2026 09:39:33 +0100
Subject: [PATCH] [channels,serial] explicitly lock serial->IrpThreads

---
 channels/serial/client/serial_main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: freerdp-2.11.7/channels/serial/client/serial_main.c
===================================================================
--- freerdp-2.11.7.orig/channels/serial/client/serial_main.c
+++ freerdp-2.11.7/channels/serial/client/serial_main.c
@@ -595,7 +595,9 @@ static void create_irp_thread(SERIAL_DEV
 	 * observed with FreeRDP).
 	 */
 	key = irp->CompletionId;
+    ListDictionary_Lock(serial->IrpThreads);
 	previousIrpThread = ListDictionary_GetItemValue(serial->IrpThreads, (void*)key);
+    ListDictionary_Unlock(serial->IrpThreads);
 
 	if (previousIrpThread)
 	{
@@ -693,7 +695,9 @@ static void terminate_pending_irp_thread
 		WLog_Print(serial->log, WLOG_DEBUG, "IRP thread terminated, CompletionId %p", (void*)id);
 	}
 
+    ListDictionary_Lock(serial->IrpThreads);
 	ListDictionary_Clear(serial->IrpThreads);
+    ListDictionary_Unlock(serial->IrpThreads);
 	free(ids);
 }
 
openSUSE Build Service is sponsored by