Use safe memset in derive_key_v2
Closed this issue · 0 comments
alex-chew commented
In aws_cryptosdk_private_derive_key_v2
we write:
aws-encryption-sdk-c/source/cipher.c
Line 360 in 939c422
with the intention that props->commitment_len
may be zero, in which case commitment->buffer
is not writable, but this is OK since the memset
would be a no-op. The C standard says that even in this case the pointer argument commitment->buffer
must be valid. We should change this so that memset
is not called with an invalid pointer argument.