httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r345128 - in /httpd/httpd/trunk/modules/database: mod_dbd.c mod_dbd.h
Date Wed, 16 Nov 2005 21:20:38 GMT
Author: niq
Date: Wed Nov 16 13:20:33 2005
New Revision: 345128

URL: http://svn.apache.org/viewcvs?rev=345128&view=rev
Log:
Add defaults and comments for better robustness against misuse
(based on comments from Chris Darroch).

Modified:
    httpd/httpd/trunk/modules/database/mod_dbd.c
    httpd/httpd/trunk/modules/database/mod_dbd.h

Modified: httpd/httpd/trunk/modules/database/mod_dbd.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/database/mod_dbd.c?rev=345128&r1=345127&r2=345128&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/database/mod_dbd.c (original)
+++ httpd/httpd/trunk/modules/database/mod_dbd.c Wed Nov 16 13:20:33 2005
@@ -185,6 +185,7 @@
 {
     svr_cfg *svr = (svr_cfg*) apr_pcalloc(p, sizeof(svr_cfg));
     svr->persist = -1;
+    svr->name = svr->params = ""; /* don't risk segfault on misconfiguration */
 #if APR_HAS_THREADS
     svr->nmin = DEFAULT_NMIN;
     svr->nkeep = DEFAULT_NKEEP;

Modified: httpd/httpd/trunk/modules/database/mod_dbd.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/database/mod_dbd.h?rev=345128&r1=345127&r2=345128&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/database/mod_dbd.h (original)
+++ httpd/httpd/trunk/modules/database/mod_dbd.h Wed Nov 16 13:20:33 2005
@@ -64,7 +64,10 @@
  */
 AP_DECLARE(ap_dbd_t*) ap_dbd_cacquire(conn_rec*);
 
-/* Prepare a statement for use by a client module */
+/* Prepare a statement for use by a client module during
+ * the server startup/configuration phase.  Can't be called
+ * after the server has created its children (use apr_dbd_*).
+ */
 AP_DECLARE(void) ap_dbd_prepare(server_rec*, const char*, const char*);
 
 /* Also export them as optional functions for modules that prefer it */



Mime
View raw message