mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[UDFS]
Fix broken implementation of UDFGetFullNameInformation(). Always return full name length so that caller can allocate a big-enough buffer for later call. CORE-4375 svn path=/trunk/; revision=74914
This commit is contained in:
parent
09d56b8cff
commit
a538181140
1 changed files with 4 additions and 2 deletions
|
@ -831,20 +831,22 @@ UDFGetFullNameInformation(
|
|||
IN OUT PLONG PtrReturnedLength
|
||||
)
|
||||
{
|
||||
ULONG BytesToCopy;
|
||||
NTSTATUS RC = STATUS_SUCCESS;
|
||||
|
||||
|
||||
AdPrint(("UDFGetFullNameInformation\n"));
|
||||
|
||||
PtrBuffer->FileNameLength = FileObject->FileName.Length;
|
||||
BytesToCopy = FileObject->FileName.Length;
|
||||
|
||||
if (PtrBuffer->FileNameLength + sizeof( ULONG ) > (ULONG)(*PtrReturnedLength)) {
|
||||
|
||||
PtrBuffer->FileNameLength = *PtrReturnedLength - sizeof( ULONG );
|
||||
BytesToCopy = *PtrReturnedLength - sizeof( ULONG );
|
||||
RC = STATUS_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
RtlCopyMemory( PtrBuffer->FileName, FileObject->FileName.Buffer, PtrBuffer->FileNameLength );
|
||||
RtlCopyMemory( PtrBuffer->FileName, FileObject->FileName.Buffer, BytesToCopy );
|
||||
|
||||
// Reduce the available bytes by the amount stored into this buffer.
|
||||
*PtrReturnedLength -= sizeof( ULONG ) + PtrBuffer->FileNameLength;
|
||||
|
|
Loading…
Reference in a new issue