diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index 8f03fd858..0fca7b709 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -107,7 +107,8 @@ static WCHAR* drive_file_combine_fullpath(const WCHAR* base_path, const WCHAR* p } CopyMemory(fullpath, base_path, base_path_length); - CopyMemory((char*)fullpath + base_path_length, path, PathLength); + if (path) + CopyMemory((char*)fullpath + base_path_length, path, PathLength); drive_file_fix_path(fullpath); return fullpath; } diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c index 8340d3071..14f7c7446 100644 --- a/channels/drive/client/drive_main.c +++ b/channels/drive/client/drive_main.c @@ -880,7 +880,7 @@ static UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, { size_t i, length; DRIVE_DEVICE* drive; - UINT error; + UINT error = ERROR_INTERNAL_ERROR; if (!pEntryPoints || !name || !path) { diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 71b8c2a0f..bdb3f4ba5 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -3278,7 +3278,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) const char* drive = tok; char* start = strtok(tok, "("); char* end = strtok(NULL, ")"); - if (end) + if (start && end) name = end; if (freerdp_path_valid(name, NULL) && freerdp_path_valid(drive, NULL))