diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-09-12 20:32:08 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-09-13 10:08:32 -0700 |
commit | c81f37210cd1fec54cb409c76290a82bd1a1865e (patch) | |
tree | 6cfbbdf9b7ba97178ac87373f4f0fe0c0d98d8ec /src/coreclr | |
parent | 745952e47e1a68c16806b72d19e5a59e00d47ae9 (diff) | |
download | coreclr-c81f37210cd1fec54cb409c76290a82bd1a1865e.tar.gz coreclr-c81f37210cd1fec54cb409c76290a82bd1a1865e.tar.bz2 coreclr-c81f37210cd1fec54cb409c76290a82bd1a1865e.zip |
Fix AV in corerun on invalid filename
Before this fix, corerun would AV on certain invalid paths e.g.: corerun test.exe\
Diffstat (limited to 'src/coreclr')
-rw-r--r-- | src/coreclr/hosts/corerun/corerun.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/coreclr/hosts/corerun/corerun.cpp b/src/coreclr/hosts/corerun/corerun.cpp index a9e3b66f3b..814aac9fc4 100644 --- a/src/coreclr/hosts/corerun/corerun.cpp +++ b/src/coreclr/hosts/corerun/corerun.cpp @@ -402,7 +402,7 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo appPathPtr = appPath.OpenUnicodeBuffer(size - 1); length = WszGetFullPathName(exeName, size, appPathPtr, &filePart); } - if (length == 0 || length >= size) { + if (length == 0 || length >= size || filePart == NULL) { log << W("Failed to get full path: ") << exeName << Logger::endl; log << W("Error code: ") << GetLastError() << Logger::endl; return false; |