diff options
author | Matthew Maurer <mmaurer@google.com> | 2019-03-28 14:51:45 -0700 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-05-14 04:58:15 +0000 |
commit | a185263471f00dcb10f7710ceb7311ac0c248106 (patch) | |
tree | 585d447f1a700e4ea33efe52147ded1bc61a717b | |
parent | acdbc8688e23b39ff311b4b554be3547a47245a3 (diff) | |
download | gatekeeper-a185263471f00dcb10f7710ceb7311ac0c248106.tar.gz |
Remove potential double free
Janis noticed that GetAuthTokenKey has ownership retained by the
implementer, but the caller in libgatekeeper is delete[]ing it.
Bug: 120610663
Bug: 129768470
Test: gatekeeper-unit-tests, Gatekeeper 1.0 VTS against Trusty
Change-Id: I67171d707706b1ebe5caad47447762144495e28b
(cherry picked from commit 6d2ee18a9af8eb9d8580850e434d21e4481fa36e)
(cherry picked from commit 303e6db4d5fbdd42be5bfda1419c759f8e8e4626)
(cherry picked from commit 9d4b63592231755c52124b2ea7d57ee2b2c35ef6)
-rw-r--r-- | gatekeeper.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/gatekeeper.cpp b/gatekeeper.cpp index 0d19816..fe427bd 100644 --- a/gatekeeper.cpp +++ b/gatekeeper.cpp @@ -241,7 +241,6 @@ void GateKeeper::MintAuthToken(UniquePtr<uint8_t> *auth_token, uint32_t *length, uint32_t hash_len = (uint32_t)((uint8_t *)&token->hmac - (uint8_t *)token); ComputeSignature(token->hmac, sizeof(token->hmac), auth_token_key, key_len, reinterpret_cast<uint8_t *>(token), hash_len); - delete[] auth_token_key; } else { memset(token->hmac, 0, sizeof(token->hmac)); } |