[master] 21efe76d2 Appropriate VSL group checking

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Jun 12 04:58:10 UTC 2019


commit 21efe76d23ed81e5423c59055e55c2c5a7f29dbd
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu May 16 15:02:54 2019 +0200

    Appropriate VSL group checking
    
    We have a dedicated enum entry for that, and nothing prevents the caller
    from passing a negative value.

diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index fb284a58a..b27646113 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -1088,7 +1088,7 @@ VSLQ_New(struct VSL_data *vsl, struct VSL_cursor **cp,
 	struct VSLQ *vslq;
 
 	CHECK_OBJ_NOTNULL(vsl, VSL_MAGIC);
-	if (grouping > VSL_g_session) {
+	if (grouping < 0 || grouping >= VSL_g__MAX) {
 		(void)vsl_diag(vsl, "Illegal query grouping");
 		return (NULL);
 	}


More information about the varnish-commit mailing list