From: tfheen Date: Mon, 2 Mar 2009 09:49:15 +0000 (+0000) Subject: Solaris fix for VRT_error X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=027541c51af4670f57cb0702bda74fe8752cc66e;p=varnish 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 --- 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); }