eric pouech (@epo) commented about programs/cmd/lineedit.c:
WriteConsoleW(hOutput, inputBuffer, len, &numWritten, NULL);
if (maxLen > len) {
ClearConsoleCharacters(hOutput, maxLen - len);
}
SetCursorVisible(hOutput, TRUE);
inputControl.nLength = sizeof(inputControl);
inputControl.nInitialChars = len;
inputControl.dwCtrlWakeupMask = (1 << 0x09) | (1 << 0x1B);
/* FIXME: In the Windows SDK this is called dwControlKeyState */
inputControl.dwConsoleKeyState = 0;
ret = ReadConsoleW(hInput, inputBuffer, inputBufferLength, numRead, &inputControl);
if (ret) {
inputBuffer[*numRead] = L'\0';
that could write past the end of buffer