[master] 4c8143186 Add missing break
Poul-Henning Kamp
phk at FreeBSD.org
Wed Aug 22 07:12:10 UTC 2018
commit 4c8143186f1d816ca77150c3f99a442d8ff405b5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Aug 22 07:08:12 2018 +0000
Add missing break
diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index 200ec18d0..2e8a8961b 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -354,15 +354,15 @@ VRT_Strands(char *d, size_t dl, VCL_STRANDS s)
AN(s);
b = d;
e = b + dl;
- for (int i = 0; i < s->n && b < e; i++)
+ for (int i = 0; i < s->n; i++)
if (s->p[i] != NULL && *s->p[i] != '\0') {
x = strlen(s->p[i]);
- if (b + x < e)
- memcpy(b, s->p[i], x);
+ if (b + x >= e)
+ return(NULL);
+ memcpy(b, s->p[i], x);
b += x;
}
- if (b >= e)
- return (NULL);
+ assert(b < e);
*b++ = '\0';
return (b);
}
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 3851089cd..41a689732 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -437,6 +437,7 @@ h2_win_adjust(const struct h2_sess *h2, uint32_t oldval, uint32_t newval)
* rfc7540,l,2676,2680
*/
r2->t_window += (int64_t)newval - oldval;
+ break;
default:
break;
}
More information about the varnish-commit
mailing list