Commit 9cbaf930 authored by jyong2.kim's avatar jyong2.kim Committed by Uze Choi

[IOT-1040] Fixed for jira issue about RH android.

prevented crash when init is called with null String at address.

Change-Id: I390fdd036e6afae44af36d935564b2fa5045d990
Signed-off-by: default avatarjyong2.kim <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6307Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarHun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
parent 51917e87
......@@ -91,17 +91,16 @@ JNIEXPORT jint JNICALL Java_org_iotivity_ResourceHosting_ResourceHosting_OICCoor
JNIEXPORT jint JNICALL Java_org_iotivity_ResourceHosting_ResourceHosting_ResourceHostingInit
(JNIEnv *env, jobject obj,jstring j_addr)
{
const char* addr = env->GetStringUTFChars(j_addr,NULL);
if (NULL == j_addr)
{
return (jint)OCSTACK_ERROR;
}
if(OCInit(addr,USE_RANDOM_PORT,OC_CLIENT_SERVER)!=OC_STACK_OK)
if(OCInit1(OC_CLIENT_SERVER, OC_DEFAULT_FLAGS, OC_DEFAULT_FLAGS))
{
return (jint)OCSTACK_ERROR;
}
env->ReleaseStringUTFChars(j_addr,addr);
return (jint)OCSTACK_OK;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment