1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 02:58:02 -06:00

Windows driver: add defensive checks to TCCloseVolume implementation

This commit is contained in:
Mounir IDRASSI
2025-09-13 15:26:53 +09:00
parent 0b60d2a119
commit 54b81ed2d1

View File

@@ -910,8 +910,13 @@ void TCCloseVolume (PDEVICE_OBJECT DeviceObject, PEXTENSION Extension)
RestoreTimeStamp (Extension); RestoreTimeStamp (Extension);
} }
ZwClose (Extension->hDeviceFile); ZwClose (Extension->hDeviceFile);
Extension->hDeviceFile = NULL;
} }
if (Extension->pfoDeviceFile != NULL)
{
ObDereferenceObject (Extension->pfoDeviceFile); ObDereferenceObject (Extension->pfoDeviceFile);
Extension->pfoDeviceFile = NULL;
}
if (Extension->cryptoInfo) if (Extension->cryptoInfo)
{ {
crypto_close (Extension->cryptoInfo); crypto_close (Extension->cryptoInfo);