summaryrefslogtreecommitdiffstats
path: root/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
diff options
context:
space:
mode:
Diffstat (limited to 'drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c')
-rw-r--r--drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
index 7ff3c00..43b9e98 100644
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
@@ -174,7 +174,10 @@ static int FwdLockFile_DeriveKeys(FwdLockFile_Session_t * pSession) {
AES_KEY sessionRoundKeys;
unsigned char value[KEY_SIZE];
unsigned char key[KEY_SIZE];
- } *pData = malloc(sizeof *pData);
+ };
+
+ const size_t kSize = sizeof(struct FwdLockFile_DeriveKeys_Data);
+ struct FwdLockFile_DeriveKeys_Data *pData = malloc(kSize);
if (pData == NULL) {
result = FALSE;
} else {
@@ -202,7 +205,7 @@ static int FwdLockFile_DeriveKeys(FwdLockFile_Session_t * pSession) {
if (!result) {
errno = ENOSYS;
}
- memset(pData, 0, sizeof pData); // Zero out key data.
+ memset(pData, 0, kSize); // Zero out key data.
free(pData);
}
return result;