Commit 26a7ef8d authored by ylecollen's avatar ylecollen
Browse files

Clear some data before releasing them

parent 99ff3d15
...@@ -307,6 +307,7 @@ JNIEXPORT jbyteArray OLM_INBOUND_GROUP_SESSION_FUNC_DEF(decryptMessageJni)(JNIEn ...@@ -307,6 +307,7 @@ JNIEXPORT jbyteArray OLM_INBOUND_GROUP_SESSION_FUNC_DEF(decryptMessageJni)(JNIEn
if (plainTextMsgPtr) if (plainTextMsgPtr)
{ {
memset(plainTextMsgPtr, 0, maxPlainTextLength*sizeof(uint8_t));
free(plainTextMsgPtr); free(plainTextMsgPtr);
} }
} }
......
...@@ -129,6 +129,8 @@ JNIEXPORT void OLM_OUTBOUND_GROUP_SESSION_FUNC_DEF(initOutboundGroupSessionJni)( ...@@ -129,6 +129,8 @@ JNIEXPORT void OLM_OUTBOUND_GROUP_SESSION_FUNC_DEF(initOutboundGroupSessionJni)(
LOGD(" ## initOutboundGroupSessionJni(): success - result=%lu", static_cast<long unsigned int>(sessionResult)); LOGD(" ## initOutboundGroupSessionJni(): success - result=%lu", static_cast<long unsigned int>(sessionResult));
} }
// clear the random buffer
memset(randomBuffPtr, 0, randomLength);
free(randomBuffPtr); free(randomBuffPtr);
} }
} }
......
Supports Markdown
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