Check parameters before using them and not after

svn path=/trunk/; revision=58711
This commit is contained in:
Pierre Schweitzer 2013-04-07 11:35:50 +00:00
parent 3a1a8fa071
commit 84dd592090

View file

@ -421,18 +421,18 @@ KspDisableEvent(
PKSEVENT_ENTRY EventEntry;
PLIST_ENTRY Entry;
/* get current irp stack location */
IoStack = IoGetCurrentIrpStackLocation(Ctx->Irp);
/* get event data */
EventData = (PKSEVENTDATA)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
if (!Ctx || !Ctx->List || !Ctx->FileObject || !Ctx->Irp)
{
/* invalid parameter */
return FALSE;
}
/* get current irp stack location */
IoStack = IoGetCurrentIrpStackLocation(Ctx->Irp);
/* get event data */
EventData = (PKSEVENTDATA)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
/* point to first entry */
Entry = Ctx->List->Flink;