Skip to content

Commit a4b5774

Browse files
committed
starttls-gnutls: Fix crash bug in handling of DH parameter loading
The DH parameter data is only stored as a pointer, and so must NOT be deinitialized before they are used. This would cause random segfaults.
1 parent f3fd5c2 commit a4b5774

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- Fixed crash bug in STARTTLS handling of loaded DH parameters.
2+
13
-------------------------------------------------------------------------------
24
Changes in version 2.20
35

starttls-gnutls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const response* starttls_init(void)
138138
return NULL;
139139
}
140140
gnutls_certificate_set_dh_params(x509_cred, dh_params);
141-
gnutls_dh_params_deinit(dh_params);
141+
/* Don't deinit the dh_params, since the above only stores a pointer to the params. */
142142
}
143143

144144
gnutls_init(&gsession, GNUTLS_SERVER);

0 commit comments

Comments
 (0)