aboutsummaryrefslogtreecommitdiff
path: root/java/android
diff options
context:
space:
mode:
authorylecollen <ylecollen@amdocs.com>2017-01-09 15:12:15 +0100
committerylecollen <ylecollen@amdocs.com>2017-01-09 15:12:15 +0100
commit26a7ef8ddc2b9dd05d40a3d586acd778375f7cb1 (patch)
tree72494a324a3f0d8d05d2a7b5b2e29dda0fb1d02c /java/android
parent99ff3d15c81b20bc1f4cfd62c33137db8c6e8044 (diff)
Clear some data before releasing them
Diffstat (limited to 'java/android')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp1
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_outbound_group_session.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp
index 2e6e4af..a2b1624 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp
@@ -307,6 +307,7 @@ JNIEXPORT jbyteArray OLM_INBOUND_GROUP_SESSION_FUNC_DEF(decryptMessageJni)(JNIEn
if (plainTextMsgPtr)
{
+ memset(plainTextMsgPtr, 0, maxPlainTextLength*sizeof(uint8_t));
free(plainTextMsgPtr);
}
}
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_outbound_group_session.cpp b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_outbound_group_session.cpp
index 827e8fd..7330a20 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_outbound_group_session.cpp
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_outbound_group_session.cpp
@@ -129,6 +129,8 @@ JNIEXPORT void OLM_OUTBOUND_GROUP_SESSION_FUNC_DEF(initOutboundGroupSessionJni)(
LOGD(" ## initOutboundGroupSessionJni(): success - result=%lu", static_cast<long unsigned int>(sessionResult));
}
+ // clear the random buffer
+ memset(randomBuffPtr, 0, randomLength);
free(randomBuffPtr);
}
}