[PATCH] ntdll: Account for null terminating char in unload traces (Coverity).

Nikolay Sivov nsivov at codeweavers.com
Tue Apr 30 04:26:26 CDT 2019


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/ntdll/loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 994ff6f215..034b98cfee 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -177,7 +177,7 @@ static unsigned int unload_trace_seq;
 static void module_push_unload_trace( const LDR_MODULE *ldr )
 {
     RTL_UNLOAD_EVENT_TRACE *ptr = &unload_traces[unload_trace_seq];
-    unsigned int len = min(sizeof(ptr->ImageName), ldr->BaseDllName.Length);
+    unsigned int len = min(sizeof(ptr->ImageName) - sizeof(WCHAR), ldr->BaseDllName.Length);
 
     ptr->BaseAddress = ldr->BaseAddress;
     ptr->SizeOfImage = ldr->SizeOfImage;
-- 
2.20.1




More information about the wine-devel mailing list