Skip to content

Commit a55d3a8

Browse files
author
duke
committed
Backport 0285020c7ea01f32b32efe166a0a5dae39957216
1 parent 82ccb07 commit a55d3a8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/java.base/unix/native/libjava/ProcessImpl_md.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath)
558558
return -1;
559559
}
560560
offset = copystrings(buf, 0, &c->argv[0]);
561-
offset = copystrings(buf, offset, &c->envv[0]);
561+
if (c->envv != NULL) {
562+
offset = copystrings(buf, offset, &c->envv[0]);
563+
}
562564
if (c->pdir != NULL) {
563565
if (sp.dirlen > 0) {
564566
memcpy(buf+offset, c->pdir, sp.dirlen);

0 commit comments

Comments
 (0)