dd57731 SecurityPkg Tpm2CommandLib: Fix TPM2.0 response memory overflow

Authored and Committed by Zhang, Chao B 6 years ago
    SecurityPkg Tpm2CommandLib: Fix TPM2.0 response memory overflow
    
    TPM2.0 command lib always assumes TPM device and transmission channel can
    respond correctly. But it is not true when communication channel is exploited
    and wrong data is spoofed. Add more logic to prohibit memory overflow attack.
    
    Cc: Long Qin <qin.long@intel.com>
    Cc: Yao Jiewen <jiewen.yao@intel.com>
    Contributed-under: TianoCore Contribution Agreement 1.1
    Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
    Reviewed-by: Long Qin <qin.long@intel.com>
    Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>