mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
help static analysis tools
This commit is contained in:
@@ -1186,7 +1186,7 @@ int wc_RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
|||||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
||||||
return plainLen;
|
return plainLen;
|
||||||
}
|
}
|
||||||
if (plainLen > (int)outLen)
|
if (plainLen > (int)outLen || pad == NULL)
|
||||||
plainLen = BAD_FUNC_ARG;
|
plainLen = BAD_FUNC_ARG;
|
||||||
else
|
else
|
||||||
XMEMCPY(out, pad, plainLen);
|
XMEMCPY(out, pad, plainLen);
|
||||||
@@ -1305,7 +1305,7 @@ int wc_RsaSSL_Verify(const byte* in, word32 inLen, byte* out, word32 outLen,
|
|||||||
return plainLen;
|
return plainLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plainLen > (int)outLen)
|
if (plainLen > (int)outLen || pad == NULL)
|
||||||
plainLen = BAD_FUNC_ARG;
|
plainLen = BAD_FUNC_ARG;
|
||||||
else
|
else
|
||||||
XMEMCPY(out, pad, plainLen);
|
XMEMCPY(out, pad, plainLen);
|
||||||
|
@@ -3957,6 +3957,7 @@ int memory_test(void)
|
|||||||
return -113; /* should round to 0 since struct + bucket will not fit */
|
return -113; /* should round to 0 since struct + bucket will not fit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(void)dist; /* avoid static analysis warning of variable not used */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* WOLFSSL_STATIC_MEMORY */
|
#endif /* WOLFSSL_STATIC_MEMORY */
|
||||||
|
Reference in New Issue
Block a user