[master] 483bc96 Flexelinting

Poul-Henning Kamp phk at FreeBSD.org
Thu Nov 2 12:02:07 UTC 2017


commit 483bc96522f5cfc4045bd5e0fbb06b915222d079
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Nov 2 06:52:06 2017 +0000

    Flexelinting

diff --git a/bin/varnishd/http2/cache_http2.h b/bin/varnishd/http2/cache_http2.h
index fd720e6..2883789 100644
--- a/bin/varnishd/http2/cache_http2.h
+++ b/bin/varnishd/http2/cache_http2.h
@@ -223,7 +223,7 @@ h2_error H2_Send(struct worker *, struct h2_req *,
 /* cache_http2_proto.c */
 struct h2_req * h2_new_req(const struct worker *, struct h2_sess *,
     unsigned stream, struct req *);
-void h2_del_req(struct worker *, struct h2_req *);
+void h2_del_req(struct worker *, const struct h2_req *);
 void h2_kill_req(struct worker *, const struct h2_sess *,
     struct h2_req *, h2_error);
 int h2_rxframe(struct worker *, struct h2_sess *);
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 0358acd..90b4b6d 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -161,7 +161,7 @@ h2_new_req(const struct worker *wrk, struct h2_sess *h2,
 }
 
 void
-h2_del_req(struct worker *wrk, struct h2_req *r2)
+h2_del_req(struct worker *wrk, const struct h2_req *r2)
 {
 	struct h2_sess *h2;
 	struct sess *sp;
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index 5ed5cd0..6b0586d 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -396,6 +396,10 @@ vmod_workspace_allocate(VRT_CTX, VCL_ENUM which, VCL_INT size)
 		size += WS_Reserve(ws, 0);
 		WS_Release(ws, 0);
 	}
+	if (size <= 0) {
+		VRT_fail(ctx, "Attempted negative WS allocation");
+		return;
+	}
 	s = WS_Alloc(ws, size);
 	if (!s)
 		return;
diff --git a/lib/libvmod_vtc/vmod_vtc.c b/lib/libvmod_vtc/vmod_vtc.c
index 9f8bbf9..04e79c6 100644
--- a/lib/libvmod_vtc/vmod_vtc.c
+++ b/lib/libvmod_vtc/vmod_vtc.c
@@ -151,7 +151,10 @@ vmod_workspace_alloc(VRT_CTX, VCL_ENUM which, VCL_INT size)
 		size += WS_Reserve(ws, 0);
 		WS_Release(ws, 0);
 	}
-
+	if (size <= 0) {
+		VRT_fail(ctx, "Attempted negative WS allocation");
+		return;
+	}
 	p = WS_Alloc(ws, size);
 	if (p == NULL)
 		VRT_fail(ctx, "vtc.workspace_alloc");


More information about the varnish-commit mailing list