cryptfs: Avoid dereferencing null pointer
We already know that "intermediate_key" is non-NULL here. We care if the result of the allocation, "*intermediate_key", is non-NULL prior to our memcpy. Change-Id: I83e22dfadabb870d527b93b31470bf47e22201bb
This commit is contained in:
parent
9247987e84
commit
e8167afe55
1 changed files with 1 additions and 1 deletions
|
@ -1452,7 +1452,7 @@ static int decrypt_master_key_aux(const char *passwd, unsigned char *salt,
|
|||
/* Copy intermediate key if needed by params */
|
||||
if (intermediate_key && intermediate_key_size) {
|
||||
*intermediate_key = (unsigned char*) malloc(KEY_LEN_BYTES);
|
||||
if (intermediate_key) {
|
||||
if (*intermediate_key) {
|
||||
memcpy(*intermediate_key, ikey, KEY_LEN_BYTES);
|
||||
*intermediate_key_size = KEY_LEN_BYTES;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue