[prev in list] [next in list] [prev in thread] [next in thread]
List: varnish-commit
Subject: [master] 532dcd3fb Close a one-in-a-billion risk of unwarranted panic.
From: Poul-Henning Kamp <phk () FreeBSD ! org>
Date: 2021-02-22 13:27:07
Message-ID: 20210222132707.3637010AD0E () lists ! varnish-cache ! org
[Download RAW message or body]
commit 532dcd3fbfea5cafb8fb628d0826c85a8ad38b44
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date: Mon Feb 22 12:56:48 2021 +0000
Close a one-in-a-billion risk of unwarranted panic.
Spotted by: Rasmus Villemoes
diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c
index 7af1a5712..a8f3d2f36 100644
--- a/bin/varnishd/cache/cache_lck.c
+++ b/bin/varnishd/cache/cache_lck.c
@@ -218,7 +218,7 @@ Lck_CondWait(pthread_cond_t *cond, struct lock *lck, vtim_real when)
assert(when > 1e9);
ts.tv_nsec = (long)(modf(when, &t) * 1e9);
ts.tv_sec = (long)t;
- assert(ts.tv_nsec >= 0 && ts.tv_nsec < 999999999);
+ assert(ts.tv_nsec >= 0 && ts.tv_nsec <= 999999999);
errno = pthread_cond_timedwait(cond, &ilck->mtx, &ts);
#if defined (__APPLE__)
if (errno == EINVAL && when > VTIM_real()) {
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic