[master] 1dc22f0 Pass the right string to syslog()

Federico G. Schwindt fgsch at lodoss.net
Tue Aug 19 11:50:12 CEST 2014


commit 1dc22f0c75f5546272ac0b06f2a44c4b643d07dd
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue Aug 19 10:42:46 2014 +0100

    Pass the right string to syslog()
    
    Fixes #1574

diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index c5d0cfe..a74e6a4 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -156,18 +156,18 @@ vmod_log(const struct vrt_ctx *ctx, const char *fmt, ...)
 VCL_VOID __match_proto__(td_std_syslog)
 vmod_syslog(const struct vrt_ctx *ctx, VCL_INT fac, const char *fmt, ...)
 {
-	char *p;
 	unsigned u;
 	va_list ap;
+	txt t;
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	u = WS_Reserve(ctx->ws, 0);
-	p = ctx->ws->f;
+	t.b = ctx->ws->f;
 	va_start(ap, fmt);
-	p = VRT_StringList(p, u, fmt, ap);
+	t.e = VRT_StringList(t.b, u, fmt, ap);
 	va_end(ap);
-	if (p != NULL)
-		syslog((int)fac, "%s", p);
+	if (t.e != NULL)
+		syslog((int)fac, "%s", t.b);
 	WS_Release(ctx->ws, 0);
 }
 



More information about the varnish-commit mailing list