]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg: Fix bug in TPM 1.2 SelfTest
authorSamer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Thu, 28 Apr 2016 20:29:27 +0000 (04:29 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Tue, 3 May 2016 02:10:53 +0000 (10:10 +0800)
Fix uninitialized command Length variable in TPM1.2 Self Test command

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
SecurityPkg/Library/Tpm12CommandLib/Tpm12SelfTest.c

index cd08d193ab876261a7401562e4025306bb42a203..8e232ee5b857b47c34d46ac50000b743d5673369 100644 (file)
@@ -2,6 +2,7 @@
   Implement TPM1.2 NV Self Test related commands.\r
 \r
 Copyright (c) 2016, Intel Corporation. All rights reserved. <BR>\r
   Implement TPM1.2 NV Self Test related commands.\r
 \r
 Copyright (c) 2016, Intel Corporation. All rights reserved. <BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
 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
@@ -42,5 +43,6 @@ Tpm12ContinueSelfTest (
   Command.tag       = SwapBytes16 (TPM_TAG_RQU_COMMAND);\r
   Command.paramSize = SwapBytes32 (sizeof (Command));\r
   Command.ordinal   = SwapBytes32 (TPM_ORD_ContinueSelfTest);\r
   Command.tag       = SwapBytes16 (TPM_TAG_RQU_COMMAND);\r
   Command.paramSize = SwapBytes32 (sizeof (Command));\r
   Command.ordinal   = SwapBytes32 (TPM_ORD_ContinueSelfTest);\r
+  Length = sizeof (Response);\r
   return Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
 }\r
   return Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
 }\r