8222529: sun.jdwp.listenerAddress agent property uses wrong encoding

Reviewed-by: sspitsyn, amenkov, clanger, erikj
This commit is contained in:
Ralf Schmelter 2019-04-17 01:21:56 -07:00
parent a722889681
commit ebedd5cb26
2 changed files with 4 additions and 3 deletions
make/lib
src/jdk.jdwp.agent/share/native/libjdwp

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -66,6 +66,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
LIBS_solaris := $(LIBDL), \
LIBS_macosx := -liconv, \
LIBS_aix := -liconv, \
LIBS_windows := $(WIN_JAVA_LIB), \
))
$(BUILD_LIBJDWP): $(call FindLib, java.base, java)

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, 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
@ -1673,7 +1673,7 @@ setAgentPropertyValue(JNIEnv *env, char *propertyName, char* propertyValue)
/* Create jstrings for property name and value */
nameString = JNI_FUNC_PTR(env,NewStringUTF)(env, propertyName);
if (nameString != NULL) {
valueString = JNI_FUNC_PTR(env,NewStringUTF)(env, propertyValue);
valueString = JNU_NewStringPlatform(env, propertyValue);
if (valueString != NULL) {
/* invoke Properties.setProperty */
JNI_FUNC_PTR(env,CallObjectMethod)