From 027541c51af4670f57cb0702bda74fe8752cc66e Mon Sep 17 00:00:00 2001 From: tfheen Date: Mon, 2 Mar 2009 09:49:15 +0000 Subject: [PATCH] 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 git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3847 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_vrt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index 80b0566a..08598a3d 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -62,7 +62,8 @@ VRT_error(struct sess *sp, unsigned code, const char *reason) { 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); } -- 2.39.5