mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
fix for scan build warning and better check on size
This commit is contained in:
@@ -26821,14 +26821,14 @@ static int DecodeAsymKey(const byte* input, word32* inOutIdx, word32 inSz,
|
||||
if (GetOctetString(input, inOutIdx, &privSz, inSz) < 0)
|
||||
return ASN_PARSE_E;
|
||||
|
||||
if ((word32)privSz > *privKeyLen)
|
||||
return BUFFER_E;
|
||||
|
||||
priv = input + *inOutIdx;
|
||||
*inOutIdx += privSz;
|
||||
endKeyIdx = *inOutIdx;
|
||||
}
|
||||
|
||||
if ((word32)privSz > *privKeyLen)
|
||||
return BUFFER_E;
|
||||
|
||||
if (endKeyIdx == (int)*inOutIdx) {
|
||||
*privKeyLen = privSz;
|
||||
XMEMCPY(privKey, priv, *privKeyLen);
|
||||
@@ -26836,6 +26836,10 @@ static int DecodeAsymKey(const byte* input, word32* inOutIdx, word32 inSz,
|
||||
*pubKeyLen = 0;
|
||||
}
|
||||
else {
|
||||
if (pubKeyLen == NULL) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
if (GetASNHeader(input, ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | 1,
|
||||
inOutIdx, &length, inSz) < 0) {
|
||||
return ASN_PARSE_E;
|
||||
|
Reference in New Issue
Block a user