Do not write usbdevicestoredirect if the string is NULL (#7347)

This commit is contained in:
akallabeth 2021-10-12 11:04:09 +02:00 committed by GitHub
parent 834fdf0046
commit 6c58e821dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -898,6 +898,7 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSett
UINT32 LoadBalanceInfoLength;
const char* GatewayHostname = NULL;
char* redirectCameras = NULL;
char* redirectUsb = NULL;
if (!FILE_POPULATE_STRING(&file->Domain, settings, FreeRDP_Domain) ||
!FILE_POPULATE_STRING(&file->Username, settings, FreeRDP_Username) ||
@ -1058,8 +1059,10 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSett
file->RedirectCameras = redirectCameras;
}
#ifdef CHANNEL_URBDRC_CLIENT
file->UsbDevicesToRedirect =
freerdp_client_channel_args_to_string(settings, URBDRC_CHANNEL_NAME, "device:");
redirectUsb = freerdp_client_channel_args_to_string(settings, URBDRC_CHANNEL_NAME, "device:");
if (redirectUsb)
file->UsbDevicesToRedirect = redirectUsb;
#endif
file->RedirectClipboard = freerdp_settings_get_bool(settings, FreeRDP_RedirectClipboard);
file->RedirectPrinters = freerdp_settings_get_bool(settings, FreeRDP_RedirectPrinters);