From d294b9a4b7ec9cbf96bf8975d9d0ca04386f8e3a Mon Sep 17 00:00:00 2001 From: erictian Date: Wed, 12 Sep 2012 08:24:10 +0000 Subject: [PATCH] MdeModulePkg/VariableSmm: Fix a VariableSmm bug when reading variable with size 0. Signed-off-by: Tian, Feng Reviewed-by: Zhang, Chao git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13725 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c index 0a6c872baa..15e55d417e 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c @@ -426,7 +426,7 @@ SmmVariableHandler ( return EFI_SUCCESS; } - if (*CommBufferSize < sizeof(SMM_VARIABLE_COMMUNICATE_HEADER) - 1) { + if (*CommBufferSize < SMM_VARIABLE_COMMUNICATE_HEADER_SIZE) { return EFI_SUCCESS; }