mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 02:58:02 -06:00
Static Code Analysis : Use Safe string functions inside VeraCrypt Device Driver to avoid potential security issues. Add many checks for NULL pointers to handle low memory use cases.
This commit is contained in:
@@ -510,6 +510,15 @@ static VOID MainThreadProc (PVOID threadArg)
|
||||
KeWaitForSingleObject (&queue->QueueResumedEvent, Executive, KernelMode, FALSE, NULL);
|
||||
|
||||
item = GetPoolBuffer (queue, sizeof (EncryptedIoQueueItem));
|
||||
if (!item)
|
||||
{
|
||||
TCCompleteDiskIrp (irp, STATUS_INSUFFICIENT_RESOURCES, 0);
|
||||
DecrementOutstandingIoCount (queue);
|
||||
IoReleaseRemoveLock (&queue->RemoveLock, irp);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
item->Queue = queue;
|
||||
item->OriginalIrp = irp;
|
||||
item->Status = STATUS_SUCCESS;
|
||||
@@ -687,6 +696,11 @@ static VOID MainThreadProc (PVOID threadArg)
|
||||
|
||||
// Create IO request
|
||||
request = GetPoolBuffer (queue, sizeof (EncryptedIoRequest));
|
||||
if (!request)
|
||||
{
|
||||
CompleteOriginalIrp (item, STATUS_INSUFFICIENT_RESOURCES, 0);
|
||||
break;
|
||||
}
|
||||
request->Item = item;
|
||||
request->CompleteOriginalIrp = isLastFragment;
|
||||
request->Offset = fragmentOffset;
|
||||
|
||||
Reference in New Issue
Block a user