Fix infinite loop in CMS

Fix loop in do_free_upto if cmsbio is NULL: this will happen when attempting
to verify and a digest is not recognised. Reported by Johannes Bauer.

CVE-2015-1792

Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
Dr. Stephen Henson 2015-06-05 12:11:25 +01:00 committed by Matt Caswell
parent 8aa556e1c3
commit aa5ab40860

View File

@ -132,7 +132,7 @@ static void do_free_upto(BIO *f, BIO *upto)
BIO_free(f); BIO_free(f);
f = tbio; f = tbio;
} }
while (f != upto); while (f && f != upto);
} else } else
BIO_free_all(f); BIO_free_all(f);
} }