]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
add a check for the return of sk_SRP_gN_new_null() so that capture the potential...
authorxkernel <xkernel.wang@foxmail.com>
Tue, 18 Oct 2022 16:54:26 +0000 (00:54 +0800)
committerPauli <pauli@openssl.org>
Thu, 20 Oct 2022 08:04:44 +0000 (19:04 +1100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19435)

crypto/srp/srp_vfy.c

index b490845e22f07ce8b05234f4f385b1a5e1b9efff..72ef5e814e68cdbaee29a9cb208b1e4433d0100e 100644 (file)
@@ -391,7 +391,7 @@ static BIGNUM *SRP_gN_place_bn(STACK_OF(SRP_gN_cache) *gN_cache, char *ch)
 
 int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file)
 {
-    int error_code;
+    int error_code = SRP_ERR_MEMORY;
     STACK_OF(SRP_gN) *SRP_gN_tab = sk_SRP_gN_new_null();
     char *last_index = NULL;
     int i;
@@ -403,6 +403,9 @@ int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file)
     TXT_DB *tmpdb = NULL;
     BIO *in = BIO_new(BIO_s_file());
 
+    if (SRP_gN_tab == NULL)
+        goto err;
+
     error_code = SRP_ERR_OPEN_FILE;
 
     if (in == NULL || BIO_read_filename(in, verifier_file) <= 0)