mirror of
https://github.com/reactos/reactos.git
synced 2025-06-11 04:47:22 +00:00
[CMD] Use string-safe call to build the new console title (possibly truncated, we don't care), avoiding any buffer overflow. Caught by David Quintana.
This commit is contained in:
parent
7b618314c2
commit
ddd03a8973
2 changed files with 4 additions and 1 deletions
|
@ -382,7 +382,8 @@ Execute(LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
|
|||
/* Save the original console title and build a new one */
|
||||
GetConsoleTitle(szWindowTitle, ARRAYSIZE(szWindowTitle));
|
||||
bTitleSet = FALSE;
|
||||
_stprintf(szNewTitle, _T("%s - %s%s"), szWindowTitle, First, Rest);
|
||||
StringCchPrintf(szNewTitle, ARRAYSIZE(szNewTitle),
|
||||
_T("%s - %s%s"), szWindowTitle, First, Rest);
|
||||
ConSetTitle(szNewTitle);
|
||||
|
||||
/* check if this is a .BAT or .CMD file */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue