audk/MdeModulePkg/Universal/Console
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
..
ConPlatformDxe MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
ConSplitterDxe MdeModulePkg/ConSplitter: Change StdErr color to EFI_LIGHTGRAY 2021-01-06 05:27:29 +00:00
GraphicsConsoleDxe MdeModulePkg/Graphics: Fix spelling mistakes 2021-01-06 05:27:29 +00:00
GraphicsOutputDxe MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
TerminalDxe MdeModulePkg/TerminalDxe: Terminal fifo buffer overflow. 2021-02-03 01:56:42 +00:00