in TPMCmd/tpm/src/support/TableDrivenMarshal.c [113:127]
static TPM_RC UnmarshalBytes(
UINT8 *target, // IN/OUT: place to put the bytes
UINT8 **buffer, // IN/OUT: source of the input data
INT32 *size, // IN/OUT: remaining bytes in the input buffer
int count // IN: number of bytes to get
)
{
if((*size -= count) >= 0)
{
memcpy(target, *buffer, count);
*buffer += count;
return TPM_RC_SUCCESS;
}
return TPM_RC_INSUFFICIENT;
}