Commit ef3d91f2 for guacamole.apache.org
commit ef3d91f2eb0901678c242791bbdb7431e63f7694
Author: Stephen Schiffli <sschiffli@keepersecurity.com>
Date: Tue Jan 6 15:12:57 2026 -0800
GUACAMOLE-1170: Use min_size with user stream pool to delay stream index reuse.
diff --git a/src/libguac/user.c b/src/libguac/user.c
index 753aca3f..882c82b4 100644
--- a/src/libguac/user.c
+++ b/src/libguac/user.c
@@ -57,8 +57,11 @@ guac_user* guac_user_alloc() {
user->processing_lag = 0;
user->active = 1;
- /* Allocate stream pool */
- user->__stream_pool = guac_pool_alloc(0);
+ /* Allocate stream pool. Use GUAC_USER_MAX_STREAMS as min_size to prefer
+ * new indices over reused ones up to the maximum, avoiding race conditions
+ * where acknowledgements for closed streams could be misdelivered to
+ * newly-allocated streams that reused the same index. */
+ user->__stream_pool = guac_pool_alloc(GUAC_USER_MAX_STREAMS);
/* Initialize streams */
user->__input_streams = guac_mem_alloc(sizeof(guac_stream), GUAC_USER_MAX_STREAMS);