mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:KD] Fix buffer overflow for the signon in KdPortInitializeEx.
The built string can be: °°Kernel Debugger: Serial port found: COM1 (Port 0x000003F8) BaudRate 115200°°°° (with ° representing the \r and \n in the message) and you can verify that this is more than 80 characters in total.
This commit is contained in:
parent
641c89d834
commit
dfc2cc4e42
1 changed files with 14 additions and 7 deletions
|
@ -106,15 +106,22 @@ KdPortInitializeEx(
|
|||
else
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
CHAR buffer[80];
|
||||
int Length;
|
||||
CHAR Buffer[82];
|
||||
|
||||
/* Print message to blue screen */
|
||||
sprintf(buffer,
|
||||
"\r\nKernel Debugger: Serial port found: COM%ld (Port 0x%p) BaudRate %ld\r\n\r\n",
|
||||
ComPortNumber,
|
||||
PortInformation->Address,
|
||||
PortInformation->BaudRate);
|
||||
HalDisplayString(buffer);
|
||||
Length = snprintf(Buffer, sizeof(Buffer),
|
||||
"\r\nKernel Debugger: Serial port found: COM%ld (Port 0x%p) BaudRate %ld\r\n\r\n",
|
||||
ComPortNumber,
|
||||
PortInformation->Address,
|
||||
PortInformation->BaudRate);
|
||||
if (Length == -1)
|
||||
{
|
||||
/* Terminate it if we went over-board */
|
||||
Buffer[sizeof(Buffer) - 1] = ANSI_NULL;
|
||||
}
|
||||
|
||||
HalDisplayString(Buffer);
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#if 0
|
||||
|
|
Loading…
Reference in a new issue