[NTVDM] Use strsafe functions for concantenation of strings in otvdm code. (#4124)

This commit is contained in:
Doug Lyons 2021-11-25 14:06:05 -06:00 committed by GitHub
parent 990ba54537
commit 0609db55d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@
#define NDEBUG
#include <debug.h>
#include <strsafe.h>
#include "emulator.h"
#include "cpu/cpu.h"
@ -803,9 +804,9 @@ WORD DosCreateProcess(IN LPCSTR ProgramName,
CHAR ExpName[MAX_PATH];
ExpandEnvironmentStringsA(AppName, ExpName, ARRAYSIZE(ExpName) - 1);
strcat(ExpName, "\""); // Add double-quote before ProgramName
strcat(ExpName, ProgramName); // Append Program name
strcat(ExpName, "\""); // Add double-quote after ProgramName
StringCbCatA(ExpName, sizeof(ExpName), "\""); // Add double-quote before ProgramName
StringCbCatA(ExpName, sizeof(ExpName), ProgramName); // Append Program name
StringCbCatA(ExpName, sizeof(ExpName), "\""); // Add double-quote after ProgramName
ZeroMemory(&pi, sizeof(pi));
ZeroMemory(&si, sizeof(si));