Permalink
Browse files

Fixed a potential NULL pointer deference.

This was brought up on dev list by Christophe Jaillet.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1443558 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent f01eae5 commit 11718a1a8126e1115e3e5bcb8be41564b393e76f Guenter Knauf committed Feb 7, 2013
Showing with 10 additions and 9 deletions.
  1. +10 −9 modules/arch/netware/mod_nw_ssl.c
@@ -1165,6 +1165,14 @@ static apr_status_t ssl_io_filter_Upgrade(ap_filter_t *f,
*/
ap_remove_output_filter(f);
+ if (!r) {
+ /*
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, APLOGNO(02131)
+ "Unable to get upgradeable socket handle");
+ */
+ return ap_pass_brigade(f->next, bb);
+ }
+
/* No need to ensure that this is a server with optional SSL, the filter
* is only inserted if that is true.
*/
@@ -1178,15 +1186,8 @@ static apr_status_t ssl_io_filter_Upgrade(ap_filter_t *f,
apr_table_unset(r->headers_out, "Upgrade");
- if (r) {
- csd_data = (secsocket_data*)ap_get_module_config(r->connection->conn_config, &nwssl_module);
- csd = csd_data->csd;
- }
- else {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, APLOGNO(02131)
- "Unable to get upgradeable socket handle");
- return ap_pass_brigade(f->next, bb);
- }
+ csd_data = (secsocket_data*)ap_get_module_config(r->connection->conn_config, &nwssl_module);
+ csd = csd_data->csd;
/* Send the interim 101 response. */
upgradebb = apr_brigade_create(r->pool, f->c->bucket_alloc);

0 comments on commit 11718a1

Please sign in to comment.