lowleveldesign / process-governor

This application allows you to put various limits on Windows processes.
MIT License
627 stars 62 forks source link

ProcGov running as a debugger fails to pass a null-terminated string to the CreateProcess WIN32 function #60

Closed voidstar69 closed 11 months ago

voidstar69 commented 11 months ago

I used the --install option to register an executable to be started via procgov: procgov64 --install --maxmem 100M test.exe

Attempting to start that executable causes procgov to be started with the following arguments: procgov64 --debugger -maxmem 100M test.exe

This produces the following error from procgov: ERROR: Required null terminator missing. (Parameter 'lpCommandLine')

It looks like code here is not ensuring that the lpCommandLine string is terminated by a null character, which is required by the CreateProcess WIN32 function. This line of code should add a null-character to the end of the args string.