Fix potential NULL memory access

In calls to libc functions, even if the number of bytes to process is 0,
the pointer(s) need to be valid.
This change fixes a potential UB in keymaster when NULL could be passed
to memcpy().

Fixes: b/378859372
Fixes: b/378854479
Fixes: b/378820988
Fixes: b/379103248
Test: Builds
Test: VtsAidlKeyMintTargetTest and CtsKeystoreTestCases passes
Change-Id: Ie58e0bf2aa8482567015404e234f56dc896a09d1
3 files changed