mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-31 08:29:17 +01:00
fix visual studio code analysis warnings
This commit is contained in:
@@ -365,6 +365,9 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
word32 inIdx = 0;
|
||||
word32 outIdx = 0;
|
||||
|
||||
if (in == NULL || out == NULL || outLen == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (inLen == 1 && *outLen && in) {
|
||||
byte b = in[inIdx++] - 0x30; /* 0 starts at 0x30 */
|
||||
|
||||
@@ -376,7 +379,7 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
|
||||
if (b == BAD)
|
||||
return ASN_INPUT_E;
|
||||
|
||||
|
||||
out[outIdx++] = b;
|
||||
|
||||
*outLen = outIdx;
|
||||
@@ -404,7 +407,7 @@ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
|
||||
if (b == BAD || b2 == BAD)
|
||||
return ASN_INPUT_E;
|
||||
|
||||
|
||||
out[outIdx++] = (byte)((b << 4) | b2);
|
||||
inLen -= 2;
|
||||
}
|
||||
@@ -419,6 +422,9 @@ int Base16_Encode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
word32 i;
|
||||
byte hb, lb;
|
||||
|
||||
if (in == NULL || out == NULL || outLen == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (*outLen < (2 * inLen + 1))
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
|
||||
@@ -361,15 +361,17 @@ static int Hash_gen(DRBG* drbg, byte* out, word32 outSz, const byte* V)
|
||||
drbg->lastBlock = checkBlock;
|
||||
}
|
||||
|
||||
if (outSz >= OUTPUT_BLOCK_LEN) {
|
||||
XMEMCPY(out, digest, OUTPUT_BLOCK_LEN);
|
||||
outSz -= OUTPUT_BLOCK_LEN;
|
||||
out += OUTPUT_BLOCK_LEN;
|
||||
array_add_one(data, DRBG_SEED_LEN);
|
||||
}
|
||||
else if (out != NULL && outSz != 0) {
|
||||
XMEMCPY(out, digest, outSz);
|
||||
outSz = 0;
|
||||
if (out != NULL) {
|
||||
if (outSz >= OUTPUT_BLOCK_LEN) {
|
||||
XMEMCPY(out, digest, OUTPUT_BLOCK_LEN);
|
||||
outSz -= OUTPUT_BLOCK_LEN;
|
||||
out += OUTPUT_BLOCK_LEN;
|
||||
array_add_one(data, DRBG_SEED_LEN);
|
||||
}
|
||||
else if (out != NULL && outSz != 0) {
|
||||
XMEMCPY(out, digest, outSz);
|
||||
outSz = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
ForceZero(data, sizeof(data));
|
||||
|
||||
Reference in New Issue
Block a user