]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c
Check the input file pointer before use it.
[mirror_edk2.git] / SecurityPkg / Library / DxeTpmMeasureBootLib / DxeTpmMeasureBootLib.c
index d11ec13373c2b1b0454bf0cdbdef932c1109b384..5bfa282bc5e2d2dc0c3157351196385fc6f5f21a 100644 (file)
@@ -15,7 +15,7 @@
   TcgMeasureGptTable() function will receive untrusted GPT partition table, and parse\r
   partition data carefully.\r
 \r
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -371,7 +371,9 @@ TcgMeasurePeImage (
   ImageLoad->ImageLengthInMemory   = ImageSize;\r
   ImageLoad->ImageLinkTimeAddress  = LinkTimeBase;\r
   ImageLoad->LengthOfDevicePath    = FilePathSize;\r
-  CopyMem (ImageLoad->DevicePath, FilePath, FilePathSize);\r
+  if ((FilePath != NULL) && (FilePathSize != 0)) {\r
+    CopyMem (ImageLoad->DevicePath, FilePath, FilePathSize);\r
+  }\r
 \r
   //\r
   // Check PE/COFF image\r