[master] 16bc176 Only update timestamp if we got a timestamp

Martin Blix Grydeland martin at varnish-software.com
Mon Aug 8 15:04:09 CEST 2016

commit 16bc176f56fdea784cbfb661920cbc42df371763
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Aug 8 14:39:30 2016 +0200

    Only update timestamp if we got a timestamp
    If a log transaction is parsed that don't contain timestamps
    (e.g. they are filtered in varnishd), then this would cause a NULL
    pointer dereference.

diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
index b8de56f..0e7e570 100644
--- a/bin/varnishhist/varnishhist.c
+++ b/bin/varnishhist/varnishhist.c
@@ -307,7 +307,8 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 		 * only parse the last tsp seen in this transaction -
 		 * it should be the latest.
-		upd_vsl_ts(tsp);
+		if (tsp)
+			upd_vsl_ts(tsp);
 		/* phase out old data */
 		if (nhist == HIST_N) {

More information about the varnish-commit mailing list