]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
MdeModulePkg/PerfLib: Add NULL pointer check for "Token"
[mirror_edk2.git] / MdeModulePkg / Library / PeiPerformanceLib / PeiPerformanceLib.c
index 79b67e850610b0690b358ba087be0900c36fda09..f770a35a995d7a8f8a399f4dd4f1a38244b7cfac 100644 (file)
@@ -49,6 +49,10 @@ IsKnownTokens (
   IN CONST CHAR8  *Token\r
   )\r
 {\r
+  if (Token == NULL) {\r
+    return FALSE;\r
+  }\r
+\r
   if (AsciiStrCmp (Token, SEC_TOK) == 0 ||\r
       AsciiStrCmp (Token, PEI_TOK) == 0 ||\r
       AsciiStrCmp (Token, DXE_TOK) == 0 ||\r
@@ -266,7 +270,7 @@ InsertPeiFpdtMeasurement (
 \r
   //\r
   // If PERF_START()/PERF_END() have specified the ProgressID,it has high priority.\r
-  // !!! Note: If the Pref is not the known Token used in the core but have same\r
+  // !!! Note: If the Perf is not the known Token used in the core but have same\r
   // ID with the core Token, this case will not be supported.\r
   // And in currtnt usage mode, for the unkown ID, there is a general rule:\r
   // If it is start pref: the lower 4 bits of the ID should be 0.\r