【发布时间】:2021-05-15 09:24:01
【问题描述】:
如果我启动一个带有冒号参数的 Electron 程序,程序会立即退出。
Process process = new Process();
process.StartInfo.FileName = "C:\\Program Files (x86)\\SomeElectronApp.exe";
process.StartInfo.Arguments = "ab:c d";
process.Start();
process.WaitForExit();
Console.WriteLine(1); // break point here
但是,如果我交换参数以使带有冒号的参数始终排在最后,那么程序将成功启动。
这是提到here:
[This] 是针对旧 Windows 漏洞的安全缓解措施
有人知道这个缺陷是什么吗?
更新:
找到源代码here:
函数CheckCommandLineArguments有如下逻辑:
else if (IsUrlArg(argv[i])) {
block_args = true;
}
IsUrlArg 在哪里:
// colon indicates that the argument starts with a URI scheme
if (c == ':') {
// it could also be a Windows filesystem path
if (p == arg + 1)
break;
return true;
}
【问题讨论】:
标签: c# .net windows process electron