Properly check for total length in LdrpGetProcedureAddress().
It contains more than just a name.
Fixes a buffer overrun.

CID #716122

svn path=/trunk/; revision=62618
This commit is contained in:
Pierre Schweitzer 2014-04-05 13:13:01 +00:00
parent 9d713d990a
commit 283ab16ed6

View file

@ -2267,7 +2267,7 @@ LdrpGetProcedureAddress(IN PVOID BaseAddress,
}
/* Check if our buffer is large enough */
if (Name->Length > sizeof(ImportBuffer))
if (Length > sizeof(ImportBuffer))
{
/* Allocate from heap, plus 2 bytes for the Hint */
ImportName = RtlAllocateHeap(RtlGetProcessHeap(),