mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-35746: Fix segfault in ssl's cert parser (GH-11569)
Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL distribution points with empty DP or URI correctly. A malicious or buggy certificate can result into segfault. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue35746
This commit is contained in:
parent
c9f872b0bd
commit
a37f52436f
4 changed files with 51 additions and 0 deletions
|
@ -1515,6 +1515,10 @@ _get_crl_dp(X509 *certificate) {
|
|||
STACK_OF(GENERAL_NAME) *gns;
|
||||
|
||||
dp = sk_DIST_POINT_value(dps, i);
|
||||
if (dp->distpoint == NULL) {
|
||||
/* Ignore empty DP value, CVE-2019-5010 */
|
||||
continue;
|
||||
}
|
||||
gns = dp->distpoint->name.fullname;
|
||||
|
||||
for (j=0; j < sk_GENERAL_NAME_num(gns); j++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue