r3970 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Fri Mar 20 15:11:12 CET 2009


Author: tfheen
Date: 2009-03-20 15:11:12 +0100 (Fri, 20 Mar 2009)
New Revision: 3970

Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_vrt.c
Log:
Merge r3847: 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: branches/2.0/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_vrt.c	2009-03-20 13:38:18 UTC (rev 3969)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_vrt.c	2009-03-20 14:11:12 UTC (rev 3970)
@@ -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