diff options
author | ylecollen <ylecollen@amdocs.com> | 2017-01-09 15:12:15 +0100 |
---|---|---|
committer | ylecollen <ylecollen@amdocs.com> | 2017-01-09 15:12:15 +0100 |
commit | 26a7ef8ddc2b9dd05d40a3d586acd778375f7cb1 (patch) | |
tree | 72494a324a3f0d8d05d2a7b5b2e29dda0fb1d02c | |
parent | 99ff3d15c81b20bc1f4cfd62c33137db8c6e8044 (diff) |
Clear some data before releasing them
-rw-r--r-- | java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp | 1 | ||||
-rw-r--r-- | java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_outbound_group_session.cpp | 2 |
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); } } |