From 715c3f293afc8bb1173a3589ed8729831cc99e64 Mon Sep 17 00:00:00 2001 From: Kobi Mizrachi Date: Tue, 19 May 2020 14:43:30 +0300 Subject: [PATCH] server: proxy: vc hook: check if proxy client is not null --- server/proxy/pf_server.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/proxy/pf_server.c b/server/proxy/pf_server.c index 251e70a72..e0a64bed6 100644 --- a/server/proxy/pf_server.c +++ b/server/proxy/pf_server.c @@ -200,11 +200,19 @@ static BOOL pf_server_receive_channel_data_hook(freerdp_peer* peer, UINT16 chann { pServerContext* ps = (pServerContext*)peer->context; pClientContext* pc = ps->pdata->pc; - proxyData* pdata = pc->pdata; + proxyData* pdata = ps->pdata; proxyConfig* config = pdata->config; size_t i; const char* channel_name = WTSChannelGetName(peer, channelId); + /* + * client side is not initialized yet, call original callback. + * this is probably a drdynvc message between peer and proxy server, + * which doesn't need to be proxied. + */ + if (!pc) + goto original_cb; + for (i = 0; i < config->PassthroughCount; i++) { if (strncmp(channel_name, config->Passthrough[i], CHANNEL_NAME_LEN) == 0) @@ -227,6 +235,7 @@ static BOOL pf_server_receive_channel_data_hook(freerdp_peer* peer, UINT16 chann } } +original_cb: return server_receive_channel_data_original(peer, channelId, data, size, flags, totalSize); }