Module: wine Branch: master Commit: 9fcb2c88222de1943784d7b4dd7d18374706740e URL: https://source.winehq.org/git/wine.git/?a=commit;h=9fcb2c88222de1943784d7b4d...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Apr 30 12:26:26 2019 +0300
ntdll: Account for null terminating char in unload traces (Coverity).
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 994ff6f..034b98c 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;