Bug 22741

Summary: Seg fault at ssl_engine_vars.c line 658
Product: Apache httpd-2 Reporter: Gary E. Miller <gem>
Component: mod_sslAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: CLOSED FIXED    
Severity: major    
Priority: P3    
Version: 2.0.47   
Target Milestone: ---   
Hardware: PC   
OS: other   

Description Gary E. Miller 2003-08-27 03:32:39 UTC
I get a seg fault in ssl_engine_vars.c line 658.

Here is part of the gdb back trace:

(gdb) run -X
Starting program: /u3/local/apache2/bin/httpd -X
[New Thread 16384 (LWP 1777)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 1777)]
ssl_var_log_handler_c (r=0x83ed8d0, a=0x8274400 "version") at ssl_engine_vars.c:658
658         if (sslconn->ssl == NULL)
(gdb) bt
#0  ssl_var_log_handler_c (r=0x83ed8d0, a=0x8274400 "version") at
ssl_engine_vars.c:658
#1  0x08085046 in process_item (r=0x83ed8d0, orig=0x83ed8d0, item=0x82741c8)
    at mod_log_config.c:856
#2  0x080851c6 in config_log_transaction (r=0x83ed8d0, cls=0x8274d98,
default_format=0x8214cc8)
    at mod_log_config.c:919


The fix is simple in ssl_engine_vars.c:

  static const char *ssl_var_log_handler_c(request_rec *r, char *a)
  {
      SSLConnRec *sslconn = myConnConfig(r->connection);
      char *result;

+     if (sslconn == NULL) // check for bad return
+        return NULL;      // 
      if (sslconn->ssl == NULL)
         return NULL;
Comment 1 Joe Orton 2003-10-23 13:16:38 UTC
Thanks for the patch!  This has been committed to the 2.1 tree and will be
proposed for backport to 2.0.