mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8300038: Make new version of JNU_GetStringPlatformChars which checks for null characters
Reviewed-by: dfuchs, naoto
This commit is contained in:
parent
90e57fd5a9
commit
e7edf8d145
9 changed files with 187 additions and 25 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2023, 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, NULL);
|
||||
hostname = JNU_GetStringPlatformCharsStrict(env, host, NULL);
|
||||
CHECK_NULL_RETURN(hostname, NULL);
|
||||
|
||||
// try once, with our static buffer
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2023, 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
|
||||
|
@ -219,7 +219,7 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
|
|||
JNU_ThrowNullPointerException(env, "host argument is null");
|
||||
return NULL;
|
||||
}
|
||||
hostname = JNU_GetStringPlatformChars(env, host, NULL);
|
||||
hostname = JNU_GetStringPlatformCharsStrict(env, host, NULL);
|
||||
CHECK_NULL_RETURN(hostname, NULL);
|
||||
|
||||
// try once, with our static buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue