[master] e23359291 Allow a NULL value in http_Proto
Martin Blix Grydeland
martin at varnish-software.com
Tue Sep 3 10:04:05 UTC 2019
commit e23359291de6cb32144ae0ca7ae3cd688eb4ca3a
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Thu Aug 15 10:44:00 2019 +0200
Allow a NULL value in http_Proto
The proto field is optional in HTTP, so it may not be set. Set the proto
to 0 also for a NULL value instead of segfaulting if it were NULL.
diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index f1b40c861..ec65a9cb6 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -232,7 +232,8 @@ http_Proto(struct http *to)
fm = to->hd[HTTP_HDR_PROTO].b;
- if ((fm[0] == 'H' || fm[0] == 'h') &&
+ if (fm != NULL &&
+ (fm[0] == 'H' || fm[0] == 'h') &&
(fm[1] == 'T' || fm[1] == 't') &&
(fm[2] == 'T' || fm[2] == 't') &&
(fm[3] == 'P' || fm[3] == 'p') &&
More information about the varnish-commit
mailing list