Skip to content

Commit 5df562c

Browse files
author
Jonas Pfefferle
committed
nvmf: handle huge_path == null when initializing spdk
1 parent 4179d62 commit 5df562c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libdisni/src/nvmef/com_ibm_disni_nvmef_spdk_NativeDispatcher.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,15 @@ JNIEXPORT jint JNICALL Java_com_ibm_disni_nvmef_spdk_NativeDispatcher__1env_1ini
116116
}
117117
env->ReleaseIntArrayElements(transport_types, jtransport_types, 0);
118118

119-
std::vector<const char*> cargs;
119+
if (env->IsSameObject(huge_path, NULL)) {
120+
return -EFAULT;
121+
}
120122
JNIString jHugePath(env, huge_path);
123+
if (jHugePath.c_str() == NULL) {
124+
return -EFAULT;
125+
}
121126
int args_idx = 0;
127+
std::vector<const char*> cargs;
122128
cargs.push_back("--huge-dir");
123129
cargs.push_back(jHugePath.c_str());
124130

0 commit comments

Comments
 (0)