mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 15:54:22 +02:00
Address CodeQL issues (#646)
* Address CodeQL issues * Update contrib/win32/win32compat/console.c Co-authored-by: Tess Gauthier <tgauth@bu.edu> * Update contrib/win32/win32compat/console.c Co-authored-by: Tess Gauthier <tgauth@bu.edu> Co-authored-by: Tess Gauthier <tgauth@bu.edu>
This commit is contained in:
parent
043a20b808
commit
c971eda4d6
@ -627,16 +627,14 @@ ConWriteString(char* pszString, int cbString)
|
||||
if ((needed = MultiByteToWideChar(CP_UTF8, 0, pszString, cbString, NULL, 0)) == 0 ||
|
||||
(utf16 = malloc(needed * sizeof(wchar_t))) == NULL ||
|
||||
(cnt = MultiByteToWideChar(CP_UTF8, 0, pszString, cbString, utf16, needed)) == 0) {
|
||||
const char* pszStringConst = pszString;
|
||||
Result = (DWORD)printf_s(pszStringConst);
|
||||
Result = (DWORD)printf_s(pszString); // CodeQL [SM01734] false positive: call is not format string with arguments.
|
||||
}
|
||||
else {
|
||||
if (GetConsoleOutputHandle())
|
||||
WriteConsoleW(GetConsoleOutputHandle(), utf16, cnt, &Result, 0);
|
||||
else
|
||||
{
|
||||
const wchar_t* utf16Const = utf16;
|
||||
Result = (DWORD)wprintf_s(utf16Const);
|
||||
Result = (DWORD)wprintf_s(utf16); // CodeQL [SM01734] false positive: call is not format string with arguments.
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user