mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-04-29 01:03:27 +02:00
add null checks for function arguments that return BAD_FUNC_ARG
update function comment
This commit is contained in:
@@ -715,6 +715,11 @@ int SizeASN_Items(const ASNItem* asn, ASNSetData *data, int count, int* encSz)
|
||||
WOLFSSL_ENTER("SizeASN_Items");
|
||||
#endif
|
||||
|
||||
if (asn == NULL || data == NULL || count <= 0 || encSz == NULL) {
|
||||
WOLFSSL_MSG("bad arguments in SizeASN_Items");
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
/* Skip this ASN.1 item when encoding. */
|
||||
if (data[i].noOut) {
|
||||
|
||||
Reference in New Issue
Block a user