[master] 319cb74 Remove log record terminating null char before processing log lines.

Martin Blix Grydeland martin at varnish-software.com
Mon Dec 9 13:21:51 CET 2013


commit 319cb7442fc504e7b43d5f4e834265b700eed7bb
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Dec 9 12:58:43 2013 +0100

    Remove log record terminating null char before processing log lines.
    
    Fix the end of log record pointer to not include the record
    terminating null char. This caused the null to be part of the captured
    fragments and sent to the output.
    
    Fixes: #1382

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index b97d667..c1c1e36 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -746,6 +746,8 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 			tag = VSL_TAG(t->c->rec.ptr);
 			b = VSL_CDATA(t->c->rec.ptr);
 			e = b + VSL_LEN(t->c->rec.ptr);
+			while (e > b && e[-1] == '\0')
+				e--;
 
 			switch (tag) {
 			case SLT_ReqStart:



More information about the varnish-commit mailing list