audk/MdeModulePkg
gechao 839f649abb MdeModulePkg/TerminalDxe: Terminal fifo buffer overflow.
Fix the bug of terminal fifo buffer overflow with UINT8 type.

typedef struct {
  UINT8 Head;
  UINT8 Tail;
  UINT8 Data[RAW_FIFO_MAX_NUMBER + 1];
} RAW_DATA_FIFO;
RAW_FIFO_MAX_NUMBER is 256.
the data buffer size is 257 (Index from 0 to 256), but the max value of
the index, Head or Tail (UINT8), is 255. That means the last data of the
data buffer would be always empty if we use Head/Tail to output/input the
data correctly.  And because of the incorrect buffer size the FIFO full
check "((Tail + 1) % (RAW_FIFO_MAX_NUMBER + 1)) == Head" would never meet.

Signed-off-by: gechao <gechao@greatwall.com.cn>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2021-02-03 01:56:42 +00:00
..
Application MdeModulePkg/CapsuleApp: Fix spelling mistake 2020-08-07 18:53:01 +00:00
Bus MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight 2021-02-02 06:15:05 +00:00
Core MdeModulePkg: Fix undefined reference to memcpy with XCODE5 2020-12-04 02:59:38 +00:00
Include MdeModulePkg: Define the VarCheckPolicyLib and SMM interface 2020-11-17 01:03:43 +00:00
Library MdeModulePkg: SmmSmiHandlerProfileLib: Support StandaloneMm Instance 2021-02-01 10:03:14 -08:00
Logo MdeModulePkg/Logo:Add RISCV64 architecture 2020-05-07 03:17:15 +00:00
Test MdeModulePkg/Variable/RuntimeDxe: Add Variable Lock Protocol Unit Tests 2020-12-15 06:26:34 +00:00
Universal MdeModulePkg/TerminalDxe: Terminal fifo buffer overflow. 2021-02-03 01:56:42 +00:00
MdeModulePkg.ci.yaml MdeModulePkg Lzma: Update LZMA SDK version to 19.00 2021-01-08 10:03:53 +00:00
MdeModulePkg.dec MdeModulePkg: Change default value of PcdPcieResizableBarSupport to FALSE 2021-01-14 01:34:16 +00:00
MdeModulePkg.dsc MdeModulePkg: SmmSmiHandlerProfileLib: Support StandaloneMm Instance 2021-02-01 10:03:14 -08:00
MdeModulePkg.uni MdeModulePkg: Update UNI file for PCIe Resizable BAR Capability 2021-01-14 01:34:16 +00:00
MdeModulePkgExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00