Commit 1f12acbf authored by Tollef Fog Heen's avatar Tollef Fog Heen

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



git-svn-id: http://www.varnish-cache.org/svn/branches/2.0@3970 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ecf48af5
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment