summaryrefslogtreecommitdiff
path: root/src/security/tpm/tss
diff options
context:
space:
mode:
Diffstat (limited to 'src/security/tpm/tss')
-rw-r--r--src/security/tpm/tss/tcg-1.2/tss.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/security/tpm/tss/tcg-1.2/tss.c b/src/security/tpm/tss/tcg-1.2/tss.c
index 8b7778ddb2..413b68193f 100644
--- a/src/security/tpm/tss/tcg-1.2/tss.c
+++ b/src/security/tpm/tss/tcg-1.2/tss.c
@@ -215,7 +215,8 @@ uint32_t tlcl_write(uint32_t index, const void *data, uint32_t length)
to_tpm_uint32(cmd.buffer + tpm_nv_write_cmd.index, index);
to_tpm_uint32(cmd.buffer + tpm_nv_write_cmd.length, length);
- memcpy(cmd.buffer + tpm_nv_write_cmd.data, data, length);
+ if (length > 0)
+ memcpy(cmd.buffer + tpm_nv_write_cmd.data, data, length);
return tlcl_send_receive(cmd.buffer, response, sizeof(response));
}