mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[UDFS] Fix NewCFBName leakage in UDFFirstOpenFile()
CORE-11098
This commit is contained in:
parent
b64865fbdf
commit
e5e4362b6d
1 changed files with 9 additions and 3 deletions
|
@ -2312,7 +2312,10 @@ UDFFirstOpenFile(
|
|||
((LocalPath->Buffer[LocalPath->Length/sizeof(WCHAR)-1] != L':') /*&&
|
||||
(LocalPath->Buffer[LocalPath->Length/sizeof(WCHAR)-1] != L'\\')*/) )) {
|
||||
RC = MyAppendUnicodeToString(&(NewFCBName->ObjectName), L"\\");
|
||||
if(!NT_SUCCESS(RC)) return STATUS_INSUFFICIENT_RESOURCES;
|
||||
if(!NT_SUCCESS(RC)) {
|
||||
UDFReleaseObjectName(NewFCBName);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
}
|
||||
|
||||
// Make link between Fcb and FileInfo
|
||||
|
@ -2321,9 +2324,11 @@ UDFFirstOpenFile(
|
|||
(*PtrNewFcb)->ParentFcb = RelatedFileInfo->Fcb;
|
||||
|
||||
if(!((*PtrNewFcb)->NTRequiredFCB = NewFileInfo->Dloc->CommonFcb)) {
|
||||
if(!((*PtrNewFcb)->NTRequiredFCB =
|
||||
(PtrUDFNTRequiredFCB)MyAllocatePool__(NonPagedPool, UDFQuadAlign(sizeof(UDFNTRequiredFCB))) ) )
|
||||
(*PtrNewFcb)->NTRequiredFCB = (PtrUDFNTRequiredFCB)MyAllocatePool__(NonPagedPool, UDFQuadAlign(sizeof(UDFNTRequiredFCB)));
|
||||
if(!((*PtrNewFcb)->NTRequiredFCB)) {
|
||||
UDFReleaseObjectName(NewFCBName);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
UDFPrint(("UDFAllocateNtReqFCB: %x\n", (*PtrNewFcb)->NTRequiredFCB));
|
||||
RtlZeroMemory((*PtrNewFcb)->NTRequiredFCB, UDFQuadAlign(sizeof(UDFNTRequiredFCB)));
|
||||
|
@ -2333,6 +2338,7 @@ UDFFirstOpenFile(
|
|||
if(!(NewFileInfo->Dloc->CommonFcb->NtReqFCBFlags & UDF_NTREQ_FCB_VALID)) {
|
||||
(*PtrNewFcb)->NTRequiredFCB = NULL;
|
||||
BrutePoint();
|
||||
UDFReleaseObjectName(NewFCBName);
|
||||
return STATUS_ACCESS_DENIED;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue