[master] 42d9a31 Always remember what your pointers point to, when doing pointer addition.

Poul-Henning Kamp phk at varnish-cache.org
Fri Nov 25 12:41:43 CET 2011


commit 42d9a31ac0dc63f0ae971974b4a4c36c20f421ef
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Nov 25 11:40:54 2011 +0000

    Always remember what your pointers point to, when doing pointer addition.
    
    Fixes	#1065

diff --git a/bin/varnishd/cache/cache_shmlog.c b/bin/varnishd/cache/cache_shmlog.c
index a18a08e..1e414b8 100644
--- a/bin/varnishd/cache/cache_shmlog.c
+++ b/bin/varnishd/cache/cache_shmlog.c
@@ -335,7 +335,7 @@ VSM_Init(void)
 	VWMB();
 
 	vsl_start = vsl_log_start;
-	vsl_end = vsl_start + cache_param->vsl_space;
+	vsl_end = vsl_start + cache_param->vsl_space / sizeof *vsl_end;
 	vsl_ptr = vsl_start + 1;
 
 	VSC_C_main = VSM_Alloc(sizeof *VSC_C_main,



More information about the varnish-commit mailing list