Skip to content

Commit b0d2b0a

Browse files
committed
8286331: jni_GetStringUTFChars() uses wrong heap allocator
Reviewed-by: dlong, stuefe
1 parent 902b1dd commit b0d2b0a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hotspot/share/prims/jni.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ JNI_ENTRY(const char*, jni_GetStringUTFChars(JNIEnv *env, jstring string, jboole
22332233
if (s_value != NULL) {
22342234
size_t length = java_lang_String::utf8_length(java_string, s_value);
22352235
/* JNI Specification states return NULL on OOM */
2236-
result = AllocateHeap(length + 1, mtInternal, 0, AllocFailStrategy::RETURN_NULL);
2236+
result = AllocateHeap(length + 1, mtInternal, AllocFailStrategy::RETURN_NULL);
22372237
if (result != NULL) {
22382238
java_lang_String::as_utf8_string(java_string, s_value, result, (int) length + 1);
22392239
if (isCopy != NULL) {

src/hotspot/share/utilities/nativeCallStack.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@ class NativeCallStack : public StackObj {
6464
memset(_stack, 0, sizeof(_stack));
6565
}
6666

67-
NativeCallStack(int toSkip);
67+
explicit NativeCallStack(int toSkip);
6868
NativeCallStack(address* pc, int frameCount);
6969

7070
static inline const NativeCallStack& empty_stack() { return _empty_stack; }

0 commit comments

Comments
 (0)