[4.0] c1acdee Pass the right string to syslog()

Lasse Karstensen lkarsten at varnish-software.com
Mon Sep 22 16:38:23 CEST 2014


commit c1acdee858db4719676e8bf5046a2a2c2595714e
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