This is an automated email from the ASF dual-hosted git repository.
chengchengjin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 26f025f82e [GLUTEN-8894][VL] Fix buffer overflow in jStringToCString
on arm (#8895)
26f025f82e is described below
commit 26f025f82ee5ed81a2c001e3b0d8c2e61235d08f
Author: Zhiguo Wu <[email protected]>
AuthorDate: Tue Mar 4 23:11:48 2025 +0800
[GLUTEN-8894][VL] Fix buffer overflow in jStringToCString on arm (#8895)
---
cpp/core/jni/JniCommon.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpp/core/jni/JniCommon.h b/cpp/core/jni/JniCommon.h
index 246658834d..0c3096d9d6 100644
--- a/cpp/core/jni/JniCommon.h
+++ b/cpp/core/jni/JniCommon.h
@@ -39,7 +39,7 @@ static inline std::string jStringToCString(JNIEnv* env,
jstring string) {
int32_t jlen, clen;
clen = env->GetStringUTFLength(string);
jlen = env->GetStringLength(string);
- char buffer[clen];
+ char buffer[clen + 1];
env->GetStringUTFRegion(string, 0, jlen, buffer);
return std::string(buffer, clen);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]