verify previously unchecked return values

This commit is contained in:
Ruby Martin
2025-08-13 16:28:36 -06:00
parent 8d24a30996
commit 71c2878780
2 changed files with 11 additions and 6 deletions

View File

@@ -2085,11 +2085,13 @@ int wolfSSL_ASN1_get_object(const unsigned char **in, long *len, int *tag,
}
if (!err) {
/* Length at least 1, parameters valid - cannot fail to get tag. */
GetASNTag(*in, &inOutIdx, &t, (word32)inLen);
/* Get length in DER encoding. */
if (GetLength_ex(*in, &inOutIdx, &l, (word32)inLen, 0) < 0) {
WOLFSSL_MSG("GetLength error");
err = 1;
err = GetASNTag(*in, &inOutIdx, &t, (word32)inLen);
if (!err){
/* Get length in DER encoding. */
if (GetLength_ex(*in, &inOutIdx, &l, (word32)inLen, 0) < 0) {
WOLFSSL_MSG("GetLength error");
err = 1;
}
}
}
if (!err) {

View File

@@ -11664,7 +11664,10 @@ static int PrintHexWithColon(WOLFSSL_BIO* out, const byte* input,
for (in = 0; in < (word32)inlen && ret == WOLFSSL_SUCCESS; in +=
WOLFSSL_EVP_PKEY_PRINT_DIGITS_PER_LINE ) {
Indent(out, indent);
if (Indent(out, indent) < 0) {
ret = WOLFSSL_FAILURE;
break;
}
for (i = 0; (i < WOLFSSL_EVP_PKEY_PRINT_DIGITS_PER_LINE) &&
(in + i < (word32)inlen); i++) {