Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Commits

[master] 57b4594 Don't overrun the VSL segment looking for the end.

 

 

Varnish commits RSS feed   Index | Next | Previous | View Threaded


phk at varnish-cache

Aug 28, 2012, 5:25 AM

Post #1 of 1 (53 views)
Permalink
[master] 57b4594 Don't overrun the VSL segment looking for the end.

commit 57b4594c3ad86afc0f656943cf20070cb8d3af57
Author: Poul-Henning Kamp <phk [at] FreeBSD>
Date: Tue Aug 28 12:24:29 2012 +0000

Don't overrun the VSL segment looking for the end.

diff --git a/lib/libvarnishapi/vsl.c b/lib/libvarnishapi/vsl.c
index cd6034d..da9e5df 100644
--- a/lib/libvarnishapi/vsl.c
+++ b/lib/libvarnishapi/vsl.c
@@ -139,9 +139,12 @@ vsl_open(struct VSM_data *vd)
vsl->log_end = vsl->vf.e;
vsl->log_ptr = vsl->log_start + 1;
if (!vsl->d_opt) {
- while (*vsl->log_ptr != VSL_ENDMARKER)
+ while (vsl->log_ptr < vsl->log_end &&
+ *vsl->log_ptr != VSL_ENDMARKER)
vsl->log_ptr = VSL_NEXT(vsl->log_ptr);
}
+ if (vsl->log_ptr >= vsl->log_end)
+ vsl->log_ptr = vsl->log_start + 1;
return (0);
}


_______________________________________________
varnish-commit mailing list
varnish-commit [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit

Varnish commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.