Merge pull request #4512 from chipitsine/master

resolve several possible null pointer dereference
This commit is contained in:
akallabeth 2018-03-26 13:09:11 +02:00 committed by GitHub
commit 5b52ad9128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 6 deletions

View File

@ -440,7 +440,7 @@ static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive,
IRP* irp)
{
UINT32 FsInformationClass;
wStream* output = irp->output;
wStream* output = NULL;
char* volumeLabel = {"FREERDP"};
char* diskType = {"FAT32"};
WCHAR* outStr = NULL;
@ -454,6 +454,8 @@ static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive,
if (!drive || !irp)
return ERROR_INVALID_PARAMETER;
output = irp->output;
if (Stream_GetRemainingLength(irp->input) < 4)
return ERROR_INVALID_DATA;

View File

@ -577,11 +577,13 @@ void xf_ResizeDesktopWindow(xfContext* xfc, xfWindow* window, int width,
int height)
{
XSizeHints* size_hints;
rdpSettings* settings = xfc->context.settings;
rdpSettings* settings = NULL;
if (!xfc || !window)
return;
settings = xfc->context.settings;
if (!(size_hints = XAllocSizeHints()))
return;

View File

@ -38,18 +38,26 @@ int TestPathShell(int argc, char* argv[])
char* path = GetKnownPath(id);
if (!path)
{
rc = -1;
printf("%s Path: %s\n", name, path);
}
else
{
printf("%s Path: %s\n", name, path);
}
free(path);
}
{
char* path = GetKnownSubPath(id, "freerdp");
if (!path)
{
rc = -1;
printf("%s SubPath: %s\n", name, path);
}
else
{
printf("%s SubPath: %s\n", name, path);
}
free(path);
}
}