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>
This commit is contained in:
Hao Wu 2016-11-24 10:43:33 +08:00
parent a8a624d0a4
commit eebfb7b2a5
1 changed files with 2 additions and 1 deletions

View File

@ -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;