Skip to content

Commit 26f025f

Browse files
authored
[GLUTEN-8894][VL] Fix buffer overflow in jStringToCString on arm (#8895)
1 parent 81fbc0e commit 26f025f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/core/jni/JniCommon.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static inline std::string jStringToCString(JNIEnv* env, jstring string) {
3939
int32_t jlen, clen;
4040
clen = env->GetStringUTFLength(string);
4141
jlen = env->GetStringLength(string);
42-
char buffer[clen];
42+
char buffer[clen + 1];
4343
env->GetStringUTFRegion(string, 0, jlen, buffer);
4444
return std::string(buffer, clen);
4545
}

0 commit comments

Comments
 (0)