From 283ab16ed6f33072eff5989cf8d38f0de38f4235 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 13:13:01 +0000 Subject: [PATCH] [RTL] 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 --- reactos/dll/ntdll/ldr/ldrutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/ntdll/ldr/ldrutils.c b/reactos/dll/ntdll/ldr/ldrutils.c index 3c45605b5b4..8c192c08742 100644 --- a/reactos/dll/ntdll/ldr/ldrutils.c +++ b/reactos/dll/ntdll/ldr/ldrutils.c @@ -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(),