mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 21:43:32 +08: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
@ -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 */
|
||||
|
@ -25,6 +25,8 @@
|
||||
#define NTOS_MODE_USER
|
||||
#include <ndk/rtlfuncs.h>
|
||||
|
||||
#include <strsafe.h>
|
||||
|
||||
#include <conutils.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
Loading…
Reference in New Issue
Block a user