Fix NULL pointer
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 23s
Builds / ExectOS (i686) (push) Successful in 29s

This commit is contained in:
Rafal Kupiec 2024-02-16 19:05:53 +01:00
parent 00cca9a1c1
commit 109fd094ea
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -958,7 +958,7 @@ RtlpFormatWideStringArgumentSpecifier(IN PRTL_PRINT_CONTEXT Context,
GuidArg = VA_ARG(*ArgumentList, PGUID); GuidArg = VA_ARG(*ArgumentList, PGUID);
} }
/* Make sure GUID is not NULL */ /* Make sure a pointer to GUID is not NULL */
if(GuidArg != NULL) if(GuidArg != NULL)
{ {
/* Write formatted GUID string */ /* Write formatted GUID string */
@ -1143,9 +1143,13 @@ RtlpFormatWideStringArgumentSpecifier(IN PRTL_PRINT_CONTEXT Context,
AnsiStrArg = VA_ARG(*ArgumentList, PANSI_STRING); AnsiStrArg = VA_ARG(*ArgumentList, PANSI_STRING);
} }
/* Make sure a pointer to ANSI_STRING is not NULL */
if(AnsiStrArg != NULL)
{
/* Write formatted ANSI string value */ /* Write formatted ANSI string value */
Status = RtlpWriteWideStringStringValue(Context, &FormatProperties, AnsiStrArg->Buffer, AnsiStrArg->Length); Status = RtlpWriteWideStringStringValue(Context, &FormatProperties, AnsiStrArg->Buffer, AnsiStrArg->Length);
} }
}
else if(FormatProperties.VariableType == UnicodeString) else if(FormatProperties.VariableType == UnicodeString)
{ {
/* Unicode string type */ /* Unicode string type */
@ -1161,9 +1165,13 @@ RtlpFormatWideStringArgumentSpecifier(IN PRTL_PRINT_CONTEXT Context,
UnicodeStrArg = VA_ARG(*ArgumentList, PUNICODE_STRING); UnicodeStrArg = VA_ARG(*ArgumentList, PUNICODE_STRING);
} }
/* Make sure a pointer to UNICODE_STRING is not NULL */
if(UnicodeStrArg != NULL)
{
/* Write formatted UNICODE string value */ /* Write formatted UNICODE string value */
Status = RtlpWriteWideStringValue(Context, &FormatProperties, UnicodeStrArg->Buffer, UnicodeStrArg->Length); Status = RtlpWriteWideStringValue(Context, &FormatProperties, UnicodeStrArg->Buffer, UnicodeStrArg->Length);
} }
}
/* Cleanup ArgumentsCopy object */ /* Cleanup ArgumentsCopy object */
VA_END(ArgumentsCopy); VA_END(ArgumentsCopy);