Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27707)
int idx;
ASN1_STRING_TABLE fnd;
+ if (nid <= 0) {
+ ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_INVALID_ARGUMENT);
+ return NULL;
+ }
+
#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
/* "stable" can be impacted by config, so load the config file first */
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
{
ASN1_STRING_TABLE *tmp;
+ if (nid <= 0 || (minsize >= 0 && maxsize >= 0 && minsize > maxsize)) {
+ ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_INVALID_ARGUMENT);
+ return 0;
+ }
+
tmp = stable_get(nid);
if (tmp == NULL) {
ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);