[master] df9bc1860 Make WS_Allocated() assert that pointers are not in the free part of WS

Poul-Henning Kamp phk at FreeBSD.org
Wed Nov 30 08:48:06 UTC 2022


commit df9bc1860ff4d4c659aca71ec9ebcd4bdd0d31f1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Nov 30 08:47:25 2022 +0000

    Make WS_Allocated() assert that pointers are not in the free part of WS

diff --git a/bin/varnishd/cache/cache_ws.c b/bin/varnishd/cache/cache_ws.c
index d327ad757..d6ff67370 100644
--- a/bin/varnishd/cache/cache_ws.c
+++ b/bin/varnishd/cache/cache_ws.c
@@ -71,6 +71,7 @@ WS_Allocated(const struct ws *ws, const void *ptr, ssize_t len)
 	WS_Assert(ws);
 	if (len < 0)
 		len = strlen(p) + 1;
+	assert(!(p > ws->f && p <= ws->e));
 	return (p >= ws->s && (p + len) <= ws->f);
 }
 


More information about the varnish-commit mailing list