8282978: Wrong parameter passed to GetStringXXXChars in various places

Reviewed-by: alanb, dfuchs
This commit is contained in:
Zhengyu Gu 2022-03-11 13:25:09 +00:00
parent 95ca94436d
commit 0fd09d383b
9 changed files with 22 additions and 22 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -100,7 +100,7 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
JNU_ThrowNullPointerException(env, "host argument is null");
return NULL;
}
hostname = JNU_GetStringPlatformChars(env, host, JNI_FALSE);
hostname = JNU_GetStringPlatformChars(env, host, NULL);
CHECK_NULL_RETURN(hostname, NULL);
// try once, with our static buffer

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -220,7 +220,7 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
JNU_ThrowNullPointerException(env, "host argument is null");
return NULL;
}
hostname = JNU_GetStringPlatformChars(env, host, JNI_FALSE);
hostname = JNU_GetStringPlatformChars(env, host, NULL);
CHECK_NULL_RETURN(hostname, NULL);
// try once, with our static buffer