]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
MdeModulePkg/PerfLib: Add NULL pointer check for "Token"
[mirror_edk2.git] / MdeModulePkg / Library / SmmCorePerformanceLib / SmmCorePerformanceLib.c
index 2834a685d7ee266bf84297741948ffc62da96a61..dbc1166f254a2cd3c3d4cc823b58c9c7c7d602ab 100644 (file)
@@ -85,6 +85,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
@@ -497,7 +501,7 @@ InsertFpdtMeasurement (
 \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