mirror of
https://github.com/stefanberger/libtpms
synced 2025-08-24 17:39:47 +00:00
tpm2: Initialize a whole OBJECT before using it
Initialize a while OBJECT before using it. This is necessary since an OBJECT may also be used as a HASH_OBJECT via the ANY_OBJECT union and that HASH_OBJECT can leave bad size inidicators in TPM2B buffer in the OBJECT. To get rid of this problem we reset the whole OBJECT to 0 before using it. This is as if the memory for the OBJECT was just initialized. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
e56316617c
commit
17255da54c
@ -276,7 +276,8 @@ FindEmptyObjectSlot(
|
||||
if(handle)
|
||||
*handle = i + TRANSIENT_FIRST;
|
||||
// Initialize the object attributes
|
||||
MemorySet(&object->attributes, 0, sizeof(OBJECT_ATTRIBUTES));
|
||||
// MemorySet(&object->attributes, 0, sizeof(OBJECT_ATTRIBUTES));
|
||||
MemorySet(object, 0, sizeof(*object)); // libtpms added: Initialize the whole object
|
||||
return object;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user