You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Massimo Manghi <ma...@unipr.it> on 2008/12/10 18:38:50 UTC

mod_rivet segfaults when setting default charset

I found out a call to the function
apr_strcat was missing the NULL argument that works as
last argument in the variable list of args. 
This caused mod_rivet to segfault when the default charset 
needed to be set into the header.

This patch should fix the problem

Index: src/apache-2/mod_rivet.c
===================================================================
--- src/apache-2/mod_rivet.c	(revision 725291)
+++ src/apache-2/mod_rivet.c	(working copy)
@@ -307,7 +307,7 @@
     rivet_server_conf *conf = Rivet_GetConf(req);
     rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL);
 
-    if( Tcl_EvalObjEx(interp, outbuf, 0) == TCL_ERROR ) {
+    if ( Tcl_EvalObjEx(interp, outbuf, 0) == TCL_ERROR ) {
         Tcl_Obj *errscript;
         Tcl_Obj *errorCodeListObj;
         Tcl_Obj *errorCodeElementObj;
@@ -374,7 +374,7 @@
 good:
 
     if (!globals->req->headers_set && (globals->req->charset != NULL)) {
-    	TclWeb_SetHeaderType
(apr_pstrcat(globals->req->req->pool,"text/html;",globals->req->charset),globals->req);
+    	TclWeb_SetHeaderType
(apr_pstrcat(globals->req->req->pool,"text/html;",globals->req->charset,NULL),globals->req);
     }
     TclWeb_PrintHeaders(globals->req);
     Tcl_Flush(*(conf->outchannel));

-- Massimo Manghi


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org