diff options
author | Simon Rettberg | 2017-07-17 16:40:21 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-07-17 16:40:21 +0200 |
commit | 691dd6c760fd6151fbfb6f63580256573968a0ef (patch) | |
tree | dafc547b659707850980e94405053358f496a5c3 | |
parent | [run-virt] Put slash AFTER domain (...) (diff) | |
download | mltk-691dd6c760fd6151fbfb6f63580256573968a0ef.tar.gz mltk-691dd6c760fd6151fbfb6f63580256573968a0ef.tar.xz mltk-691dd6c760fd6151fbfb6f63580256573968a0ef.zip |
[run-virt] openslx.exe: Fix segfault when host name of network share cannot be resolved
-rw-r--r-- | core/modules/run-virt/winres/winres.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/modules/run-virt/winres/winres.c b/core/modules/run-virt/winres/winres.c index c2089b63..4ed18555 100644 --- a/core/modules/run-virt/winres/winres.c +++ b/core/modules/run-virt/winres/winres.c @@ -887,9 +887,11 @@ static BOOL mountNetworkShare(const netdrive_t *d, BOOL useIp) { wchar_t path[BUFLEN] = L"", user[BUFLEN] = L"", pass[BUFLEN] = L"", letter[10] = L"", shortcut[BUFLEN] = L""; int ok = -1; - if (useIp && d->pathIp[0] == '\0') + if (useIp && (d->pathIp == NULL || d->pathIp[0] == '\0')) return FALSE; const char *uncPath = useIp ? d->pathIp : d->path; + if (uncPath == NULL) + return FALSE; ok &= MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)uncPath, -1, (LPWSTR)path, BUFLEN) > 0; if (d->letter != NULL) { ok &= MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)d->letter, -1, (LPWSTR)letter, 10) > 0; |