r3847 - trunk/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Mon Mar 2 10:49:15 CET 2009


Author: tfheen
Date: 2009-03-02 10:49:15 +0100 (Mon, 02 Mar 2009)
New Revision: 3847

Modified:
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
Log:
Solaris fix for VRT_error

If VRT_error is called with reason==NULL, WSL() will eventually call
strlen(0), which will cause a SIGSEGV on (Open)Solaris.  Fix this by
checking if the reason is empty and just use (null) in that case.

Fixes: 458


Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2009-02-28 22:06:39 UTC (rev 3846)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2009-03-02 09:49:15 UTC (rev 3847)
@@ -62,7 +62,8 @@
 {
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
-	WSL(sp->wrk, SLT_Debug, 0, "VCL_error(%u, %s)", code, reason);
+	WSL(sp->wrk, SLT_Debug, 0, "VCL_error(%u, %s)", code, reason ? 
+	    reason : "(null)");
 	sp->err_code = code ? code : 503;
 	sp->err_reason = reason ? reason : http_StatusMessage(sp->err_code);
 }



More information about the varnish-commit mailing list