]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fields
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / AcpiParser.c
index 2b2ecb93cef9ee28b752e7bf2d920b059dbf7d6b..84c5f0468da55477acc96dfd0f949a5908d0f7a5 100644 (file)
@@ -543,8 +543,15 @@ ParseAcpi (
 \r
   for (Index = 0; Index < ParserItems; Index++) {\r
     if ((Offset + Parser[Index].Length) > Length) {\r
+\r
+      // For fields outside the buffer length provided, reset any pointers\r
+      // which were supposed to be updated by this function call\r
+      if (Parser[Index].ItemPtr != NULL) {\r
+        *Parser[Index].ItemPtr = NULL;\r
+      }\r
+\r
       // We don't parse past the end of the max length specified\r
-      break;\r
+      continue;\r
     }\r
 \r
     if (GetConsistencyChecking () &&\r