Bug 22741 - Seg fault at ssl_engine_vars.c line 658
Summary: Seg fault at ssl_engine_vars.c line 658
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_ssl (show other bugs)
Version: 2.0.47
Hardware: PC other
: P3 major (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2003-08-27 03:32 UTC by Gary E. Miller
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
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
#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,
    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.