[master] 6ad0fc2 Do not step into the unknown

Federico G. Schwindt fgsch at lodoss.net
Sun Apr 30 01:24:06 CEST 2017


commit 6ad0fc2fa594c95e99c8ccdcd14d989bce71d24b
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Sun Apr 30 00:22:18 2017 +0100

    Do not step into the unknown

diff --git a/lib/libvarnish/vtim.c b/lib/libvarnish/vtim.c
index 0c06f41..5e84e65 100644
--- a/lib/libvarnish/vtim.c
+++ b/lib/libvarnish/vtim.c
@@ -407,6 +407,7 @@ VTIM_timeval(double t)
 {
 	struct timeval tv;
 
+	AZ(isnan(t));
 	tv.tv_sec = (time_t)trunc(t);
 	tv.tv_usec = (int)(1e6 * (t - tv.tv_sec));
 	return (tv);
@@ -417,6 +418,7 @@ VTIM_timespec(double t)
 {
 	struct timespec tv;
 
+	AZ(isnan(t));
 	tv.tv_sec = (time_t)trunc(t);
 	tv.tv_nsec = (int)(1e9 * (t - tv.tv_sec));
 	return (tv);



More information about the varnish-commit mailing list