projects
/
platform
/
upstream
/
iotivity.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 1.1.0
[platform/upstream/iotivity.git]
/
android
/
android_api
/
base
/
jni
/
JniOcSecureResource.cpp
diff --git
a/android/android_api/base/jni/JniOcSecureResource.cpp
b/android/android_api/base/jni/JniOcSecureResource.cpp
index
f06b9bb
..
77c8dc6
100644
(file)
--- a/
android/android_api/base/jni/JniOcSecureResource.cpp
+++ b/
android/android_api/base/jni/JniOcSecureResource.cpp
@@
-211,12
+211,14
@@
OCStackResult JniOcSecureResource::provisionACL(JNIEnv* env, jobject _acl, jobje
OCStackResult ret;
JniProvisionResultListner *resultListener = AddProvisionResultListener(env, jListener);
OicSecAcl_t *acl = new OicSecAcl_t;
OCStackResult ret;
JniProvisionResultListner *resultListener = AddProvisionResultListener(env, jListener);
OicSecAcl_t *acl = new OicSecAcl_t;
- acl->next = nullptr;
+
if (!acl)
{
return OC_STACK_NO_MEMORY;
}
if (!acl)
{
return OC_STACK_NO_MEMORY;
}
+ acl->next = nullptr;
+
if (OC_STACK_OK != JniSecureUtils::convertJavaACLToOCAcl(env, _acl, acl))
{
delete acl;
if (OC_STACK_OK != JniSecureUtils::convertJavaACLToOCAcl(env, _acl, acl))
{
delete acl;
@@
-354,6
+356,12
@@
JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_removeDevice
(JNIEnv *env, jobject thiz, jint timeout, jobject jListener)
{
LOGD("OcSecureResource_removeDevice");
(JNIEnv *env, jobject thiz, jint timeout, jobject jListener)
{
LOGD("OcSecureResource_removeDevice");
+ if (timeout < 0)
+ {
+ ThrowOcException(OC_STACK_INVALID_PARAM, "Timeout value cannot be negative");
+ return;
+ }
+
if (!jListener)
{
ThrowOcException(OC_STACK_INVALID_PARAM, "provisionResultListener cannot be null");
if (!jListener)
{
ThrowOcException(OC_STACK_INVALID_PARAM, "provisionResultListener cannot be null");
@@
-564,6
+572,7
@@
JNIEXPORT jobject JNICALL Java_org_iotivity_base_OcSecureResource_getLinkedDevic
{
LOGE("%s", e.reason().c_str());
ThrowOcException(e.code(), e.reason().c_str());
{
LOGE("%s", e.reason().c_str());
ThrowOcException(e.code(), e.reason().c_str());
+ return nullptr;
}
}
}
}