https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0d4a8d0ea6fba6da0c13f597f614ebd6f20086fd

commit 0d4a8d0ea6fba6da0c13f597f614ebd6f20086fd
Author:     Roy Tam <[email protected]>
AuthorDate: Fri Jan 20 17:02:12 2023 +0800
Commit:     Roy Tam <[email protected]>
CommitDate: Fri Jan 20 17:02:12 2023 +0800

    [NTOS:MM] Ignore sections either PointerToRawData or SizeOfRawData is zero
    
    VC1 Linker fills BSS.SizeOfRawData with data in 
IMAGE_OPTIONAL_HEADER.SizeOfUninitializedData but keeps PointerToRawData to 
zero.
    
    CORE-18797
---
 ntoskrnl/mm/section.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c
index 61930738642..2fba8e89908 100644
--- a/ntoskrnl/mm/section.c
+++ b/ntoskrnl/mm/section.c
@@ -814,7 +814,7 @@ l_ReadHeaderFromFile:
             DIE(("Memory gap between section %u and the previous\n", i));
 
         /* ignore explicit BSS sections */
-        if(pishSectionHeaders[i].SizeOfRawData != 0)
+        if(pishSectionHeaders[i].PointerToRawData != 0 && 
pishSectionHeaders[i].SizeOfRawData != 0)
         {
             /* validate the alignment */
 #if 0

Reply via email to