summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/EbcDxe
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-11-24 10:43:33 +0800
committerHao Wu <hao.a.wu@intel.com>2016-11-25 13:34:24 +0800
commiteebfb7b2a52629f7c7268a9f5417ea86477c38eb (patch)
tree4acb43c1872841efbfe54332a4e65138f1154381 /MdeModulePkg/Universal/EbcDxe
parenta8a624d0a45d506f3ac1eab883226cb1cfa71bf6 (diff)
downloadedk2-eebfb7b2a52629f7c7268a9f5417ea86477c38eb.tar.gz
edk2-eebfb7b2a52629f7c7268a9f5417ea86477c38eb.tar.bz2
edk2-eebfb7b2a52629f7c7268a9f5417ea86477c38eb.zip
MdeModulePkg/EbcDebugger: Add ASSERT to ensure FieldBuffer is not NULL
In function EdbLoadCodBySymbolByIec(), AsciiStrGetNewTokenField() at line 1589 will return NULL if the first character in 'LineBuffer' is '\0'. But the previous if statement at line 1576 ensures the above case will not happen. This commit adds ASSERT as warnings for the case that will not happen. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/EbcDxe')
-rw-r--r--MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c
index 9573c43a9d..22a827d35d 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation
+Copyright (c) 2007 - 2016, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1587,6 +1587,7 @@ Returns:
// get function name, function name is followed by char 0x09.
//
FieldBuffer = AsciiStrGetNewTokenField (LineBuffer, Char);
+ ASSERT (FieldBuffer != NULL);
if (AsciiStriCmp (FieldBuffer, Name) == 0) {
BufferStart = FieldBuffer;
CodParseState = EdbEbcCodParseStateSymbolStart;