mirror of
				https://github.com/coturn/coturn.git
				synced 2025-10-26 20:41:07 +01:00 
			
		
		
		
	Fix a segfault when a TLS context is not used
If the configuration contains entries such as: no-tlsv1 no-tlsv1_1 then the SSL context is NULL. The previous code was simple enough that it handled this case; the new code needs to deal with it explicitly. [*] https://github.com/coturn/coturn/issues/770
This commit is contained in:
		
							parent
							
								
									e5f62d5c67
								
							
						
					
					
						commit
						713bbefd5e
					
				| @ -304,12 +304,17 @@ typedef struct update_ssl_ctx_cb_args { | |||||||
| 	struct event *next; | 	struct event *next; | ||||||
| } update_ssl_ctx_cb_args_t; | } update_ssl_ctx_cb_args_t; | ||||||
| 
 | 
 | ||||||
|  | /*
 | ||||||
|  |  * Copy SSL context at "from", which may be NULL if no context in use | ||||||
|  |  */ | ||||||
| static void replace_one_ssl_ctx(SSL_CTX **to, SSL_CTX *from) | static void replace_one_ssl_ctx(SSL_CTX **to, SSL_CTX *from) | ||||||
| { | { | ||||||
| 	if (*to) | 	if (*to) | ||||||
| 		SSL_CTX_free(*to); | 		SSL_CTX_free(*to); | ||||||
| 	if (from) | 
 | ||||||
|  | 	if (from != NULL) | ||||||
| 		SSL_CTX_up_ref(from); | 		SSL_CTX_up_ref(from); | ||||||
|  | 
 | ||||||
| 	*to = from; | 	*to = from; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user