Skip to content

Commit

Permalink
8286694: Incorrect argument processing in java launcher
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes
  • Loading branch information
YaSuenag committed May 19, 2022
1 parent 2a2d54e commit 26c7c92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/java.base/share/native/libjli/java.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -51,6 +51,8 @@
*/


#include <assert.h>

#include "java.h"
#include "jni.h"

Expand Down Expand Up @@ -1626,7 +1628,8 @@ TranslateApplicationArgs(int jargc, const char **jargv, int *pargc, char ***parg
for (i = 0; i < jargc; i++) {
const char *arg = jargv[i];
if (arg[0] == '-' && arg[1] == 'J') {
*nargv++ = ((arg + 2) == NULL) ? NULL : JLI_StringDup(arg + 2);
assert(arg[2] != '\0' && "Invalid JAVA_ARGS or EXTRA_JAVA_ARGS defined by build");
*nargv++ = JLI_StringDup(arg + 2);
}
}

Expand Down

0 comments on commit 26c7c92

Please sign in to comment.