Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for getCmdLineAndEnvVars which fails on x64 versions of Windows #20

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion native/envvar-cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ JNIEXPORT jstring JNICALL Java_org_jvnet_winp_Native_getCmdLineAndEnvVars(
}

int cmdLineLen = lstrlen(pszCmdLine);
size_t envSize = info.RegionSize;
size_t envSize = info.RegionSize - ((char*)pEnvStr - (char*)info.BaseAddress);

auto_localmem<LPWSTR> buf((cmdLineLen + 1/*for \0*/) * 2 + envSize);
if(!buf) {
reportError(pEnv, "Buffer allocation failed");
Expand Down