Refactor static channel name handling

1) Remove 'magic numbers' related to static channel name lengths, and
   replace with CHANNEL_NAME_LEN, or CHANNEL_NAME_LEN+1, as appropriate.
2) Always add static channel definitions, even if they are malformed.
3) Log channels which the client sends, which aren't named in
   the [Channels] section of xrdp.ini.

(cherry picked from commit 9092d898b7dceda713bd05b296ea8e8213ee614b)
This commit is contained in:
matt335672
2025-04-24 16:34:15 +01:00
parent 44acc46db4
commit 554515e39c
7 changed files with 27 additions and 32 deletions
+1 -1
View File
@@ -371,7 +371,7 @@ process_message_channel_setup(struct stream *s)
{
ci = &(g_chan_items[g_num_chan_items]);
g_memset(ci->name, 0, sizeof(ci->name));
in_uint8a(s, ci->name, 8);
in_uint8a(s, ci->name, CHANNEL_NAME_LEN + 1);
in_uint16_le(s, ci->id);
in_uint16_le(s, ci->flags);
LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_channel_setup: chan name '%s' "