formating and removing white space, also added sanity check on blob arguments

This commit is contained in:
Jacob Barthelmeh
2017-12-21 14:26:22 -07:00
parent 28582ad5d9
commit b3eef2b10e
2 changed files with 56 additions and 54 deletions

View File

@@ -215,7 +215,8 @@ int wc_caamCreateBlob(byte* data, word32 dataSz, byte* out, word32* outSz)
int ret; int ret;
word32 local[2] = {0,0}; word32 local[2] = {0,0};
if (*outSz < dataSz + WC_CAAM_BLOB_SZ) { if (data == NULL || out == NULL || outSz == NULL ||
*outSz < dataSz + WC_CAAM_BLOB_SZ) {
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
} }
@@ -250,7 +251,8 @@ int wc_caamOpenBlob(byte* data, word32 dataSz, byte* out, word32* outSz)
int ret; int ret;
word32 local[2] = {0,0}; word32 local[2] = {0,0};
if (*outSz < dataSz - WC_CAAM_BLOB_SZ) { if (data == NULL || out == NULL || outSz == NULL ||
*outSz < dataSz - WC_CAAM_BLOB_SZ) {
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
} }