[6.0] c37bed3f9 Respect the end of input buffer when skipping the second [CR]LF after the headers.
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:23 UTC 2018
commit c37bed3f9363be4d2240ebd62beb94558e4d99c4
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Aug 13 07:10:40 2018 +0000
Respect the end of input buffer when skipping the second [CR]LF
after the headers.
Fixes: #2731
diff --git a/bin/varnishd/http1/cache_http1_proto.c b/bin/varnishd/http1/cache_http1_proto.c
index ac1a2a86e..dd81863d3 100644
--- a/bin/varnishd/http1/cache_http1_proto.c
+++ b/bin/varnishd/http1/cache_http1_proto.c
@@ -206,8 +206,11 @@ http1_dissect_hdrs(struct http *hp, char *p, struct http_conn *htc,
return (400);
}
}
- if (p < htc->rxbuf_e)
- p += vct_skipcrlf(p);
+ /* We cannot use vct_skipcrlf() we have to respect rxbuf_e */
+ if (p+2 <= htc->rxbuf_e && p[0] == '\r' && p[1] == '\n')
+ p += 2;
+ else if (p+1 <= htc->rxbuf_e && p[0] == '\n')
+ p += 1;
HTC_RxPipeline(htc, p);
htc->rxbuf_e = p;
return (0);
More information about the varnish-commit
mailing list