Skip to content

Commit

Permalink
[GLUTEN-8685][VL] Add null check to avoid core dump when rss push par…
Browse files Browse the repository at this point in the history
…tition data size is large (#8686)
  • Loading branch information
zjuwangg authored Feb 10, 2025
1 parent c90f170 commit 4b741cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpp/core/jni/JniCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,10 @@ class JavaRssClient : public RssClient {
env->ReleaseByteArrayElements(array_, byteArray, JNI_ABORT);
env->DeleteGlobalRef(array_);
array_ = env->NewByteArray(size);
if (array_ == nullptr) {
LOG(WARNING) << "Failed to allocate new byte array size: " << size;
throw gluten::GlutenException("Failed to allocate new byte array");
}
array_ = static_cast<jbyteArray>(env->NewGlobalRef(array_));
}
env->SetByteArrayRegion(array_, 0, size, (jbyte*)bytes);
Expand Down

0 comments on commit 4b741cf

Please sign in to comment.